Commit 837e8f5e authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[parser] Fail early for two-byte intrinsic calls

Don't just DCHECK that intrinsic calls are one-byte, but explicitly
check and return (a failure) when they are not.

Bug: chromium:948248
Change-Id: If2c16f337e9c97e5a585d21a51a985f4abbe1c29
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547857
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60565}
parent 9ac3ec56
...@@ -347,7 +347,12 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name, ...@@ -347,7 +347,12 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name,
GetClosureScope()->ForceEagerCompilation(); GetClosureScope()->ForceEagerCompilation();
} }
DCHECK(name->is_one_byte()); if (!name->is_one_byte()) {
// There are no two-byte named intrinsics.
ReportMessage(MessageTemplate::kNotDefined, name);
return FailureExpression();
}
const Runtime::Function* function = const Runtime::Function* function =
Runtime::FunctionForName(name->raw_data(), name->length()); Runtime::FunctionForName(name->raw_data(), name->length());
......
// Copyright 2017 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
// Non-ascii intrinsic calls shouldn't crash V8.
assertThrows("%ಠ_ಠ()", SyntaxError);
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