Commit 66845820 authored by Maya Lekova's avatar Maya Lekova Committed by V8 LUCI CQ

[fastcall] Fix a crash with add_all_sequence

This CL removes an unnecessary CHECK and replaces it with
exception throwing instead.

Bug: chromium:1223107
Change-Id: If99bf289fe3a2ed5cd675ee071e9b39038e38129
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2983201
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75361}
parent 1ea33324
......@@ -144,7 +144,10 @@ class FastCApiObject {
HandleScope handle_scope(isolate);
CHECK_EQ(args.Length(), 2);
if (args.Length() < 2) {
isolate->ThrowError("This method expects at least 2 arguments.");
return;
}
if (!args[1]->IsArray()) {
isolate->ThrowError("This method expects an array as a second argument.");
return;
......
// Copyright 2021 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: --turbo-fast-api-calls --allow-natives-syntax --opt
const fast_c_api = new d8.test.FastCAPI();
assertThrows(() => {fast_c_api.add_all_sequence()});
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