Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: test/mjsunit/regress/regress-latin-1.js

Issue 12326120: Fix overflow in WriteQuoteJsonString and SlowQuoteJsonString (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-latin-1.js
diff --git a/test/mjsunit/regress/regress-latin-1.js b/test/mjsunit/regress/regress-latin-1.js
index b6cd7141a702dff897546306c564f5f50d468946..a9d895eeba3284372594881066d10c0ba2e81a5d 100644
--- a/test/mjsunit/regress/regress-latin-1.js
+++ b/test/mjsunit/regress/regress-latin-1.js
@@ -76,3 +76,15 @@ assertTrue(/[\u039b-\u039d]/i.test('\u00b5'));
assertFalse(/[^\u039b-\u039d]/i.test('\u00b5'));
assertFalse(/[\u039b-\u039d]/.test('\u00b5'));
assertTrue(/[^\u039b-\u039d]/.test('\u00b5'));
+
+// Check a regression in QuoteJsonSlow and WriteQuoteJsonString
+for (var testNumber = 0; testNumber < 2; testNumber++) {
+ var testString = "\xdc";
+ var loopLength = testNumber == 0 ? 0 : 20;
+ for (var i = 0; i < loopLength; i++ ) {
+ testString += testString;
+ }
+ var stringified = JSON.stringify({"test" : testString}, null, 0);
+ var stringifiedExpected = '{"test":"' + testString + '"}';
+ assertEquals(stringifiedExpected, stringified);
+}
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698