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

Unified Diff: test/cctest/test-parsing.cc

Issue 4800001: Fix Chromium bug 62639. (Closed)
Patch Set: Fix linto. Created 10 years, 1 month 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/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 7ae8dcfa386d038b929306129e1df66c7ff17eef..0e7466a51c8076b2126d778ad47ae1b845f30634 100755
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -270,3 +270,26 @@ TEST(StandAlonePreParser) {
CHECK(!data.has_error());
}
}
+
+
+TEST(RegressChromium62639) {
+ int marker;
+ i::StackGuard::SetStackLimit(
+ reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
+
+ // Ensure that the source code is so big that it triggers preparsing.
+ char buffer[4096];
+ const char* program_template = "var x = '%01024d'; // filler\n"
+ "escape: function() {}";
+ // Fails parsing expecting an identifier after "function".
+ // Before fix, didn't check *ok after Expect(Token::Identifier, ok),
+ // and then used the invalid currently scanned literal. This always
+ // failed in debug mode, and sometimes crashed in release mode.
+
+ snprintf(buffer, sizeof(buffer), program_template, 0);
+ unibrow::Utf8InputBuffer<256> stream(buffer, strlen(buffer));
+ i::ScriptDataImpl* data =
+ i::ParserApi::PreParse(i::Handle<i::String>::null(), &stream, NULL);
+ CHECK(data->HasError());
+ delete data;
+}
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698