From c44008b01f69785f4487c46afb15f971290baf5a Mon Sep 17 00:00:00 2001 From: vogelheim Date: Tue, 29 Nov 2016 07:05:43 -0800 Subject: [PATCH] Ensure consistent error handling on 32b/64b platforms. BUG=chromium:669017 Review-Url: https://codereview.chromium.org/2536783003 Cr-Commit-Position: refs/heads/master@{#41364} --- src/parsing/scanner.cc | 3 ++- test/message/regress/regress-crbug-669017.js | 5 +++++ test/message/regress/regress-crbug-669017.out | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/message/regress/regress-crbug-669017.js create mode 100644 test/message/regress/regress-crbug-669017.out diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc index 363ab7dfe9..39e0d831e7 100644 --- a/src/parsing/scanner.cc +++ b/src/parsing/scanner.cc @@ -1152,7 +1152,8 @@ Token::Value Scanner::ScanNumber(bool seen_period) { } if (next_.literal_chars->one_byte_literal().length() <= 10 && - value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') { + value <= Smi::kMaxValue && c0_ != '.' && + (c0_ == kEndOfInput || !unicode_cache_->IsIdentifierStart(c0_))) { next_.smi_value_ = static_cast(value); literal.Complete(); HandleLeadSurrogate(); diff --git a/test/message/regress/regress-crbug-669017.js b/test/message/regress/regress-crbug-669017.js new file mode 100644 index 0000000000..a8d76ecacd --- /dev/null +++ b/test/message/regress/regress-crbug-669017.js @@ -0,0 +1,5 @@ +// Copyright 2016 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. + +1073741824O0 diff --git a/test/message/regress/regress-crbug-669017.out b/test/message/regress/regress-crbug-669017.out new file mode 100644 index 0000000000..c2589e7a15 --- /dev/null +++ b/test/message/regress/regress-crbug-669017.out @@ -0,0 +1,8 @@ +# Copyright 2016 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. + +*%(basename)s:5: SyntaxError: Invalid or unexpected token +1073741824O0 +^^^^^^^^^^ +SyntaxError: Invalid or unexpected token