Commit 082bfec9 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[asm.js] Fix semicolon insertion in presence of Unicode.

R=clemensh@chromium.org
TEST=mjsunit/asm/regress-920076
BUG=chromium:920076

Change-Id: Ieb6d1dd84ab9434ff17ee09444e7d8ce830f898c
Reviewed-on: https://chromium-review.googlesource.com/c/1402778Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58664}
parent 3c99ee28
......@@ -343,7 +343,7 @@ void AsmJsParser::ValidateModule() {
RECURSE(ValidateModuleParameters());
EXPECT_TOKEN('{');
EXPECT_TOKEN(TOK(UseAsm));
SkipSemicolon();
RECURSE(SkipSemicolon());
RECURSE(ValidateModuleVars());
while (Peek(TOK(function))) {
RECURSE(ValidateFunction());
......
// Copyright 2019 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.
// Flags: --allow-natives-syntax
function Module() {
"use asm";
function f() {}
return f
}
eval("(" + Module.toString().replace(/;/, String.fromCharCode(8233)) + ")();");
assertFalse(%IsAsmWasmCode(Module)); // Valid asm.js, but we reject Unicode.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment