Reviewers: jarin,
Description:
Fix one more missing c0_ < 0 check in scanner
BUG=chromium:433766
Please review this at https://codereview.chromium.org/731953003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+17, -2 lines):
M src/scanner.cc
A test/mjsunit/regress/regress-crbug-433766.js
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index
bf7c9e39c42222dec3cff7bffd63e1b97f3a5993..3214c6f1c765ac9005d77179b2014224e3190641
100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -312,8 +312,7 @@ Token::Value Scanner::SkipSourceURLComment() {
void Scanner::TryToParseSourceURLComment() {
// Magic comments are of the form: //[#@]\s<name>=\s*<value>\s*.* and
this
// function will just return if it cannot parse a magic comment.
- if (!unicode_cache_->IsWhiteSpace(c0_))
- return;
+ if (c0_ < 0 || !unicode_cache_->IsWhiteSpace(c0_)) return;
Advance();
LiteralBuffer name;
while (c0_ >= 0 && !unicode_cache_->IsWhiteSpaceOrLineTerminator(c0_) &&
Index: test/mjsunit/regress/regress-crbug-433766.js
diff --git a/test/mjsunit/regress/regress-crbug-433766.js
b/test/mjsunit/regress/regress-crbug-433766.js
new file mode 100644
index
0000000000000000000000000000000000000000..fae94837d464d98614e814a12da2a21ba6f17fa0
--- /dev/null
+++ b/test/mjsunit/regress/regress-crbug-433766.js
@@ -0,0 +1,16 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var filler = "//" + new Array(('@')).join('x');
+
+// Test strict eval in global context.
+eval(
+ "'use strict';" +
+ "var x = 23;" +
+ "var f = function bozo1() {" +
+ " return x;" +
+ "};" +
+ "f;" +
+ filler
+)();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.