Commit bab8254c authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[regexp][arm] Fix regexp assembler abortion

When aborting code generation, we need to call {AbortedCodeGeneration}
on the {MacroAssembler} contained in the {RegExpMacroAssemblerARM}.

R=jgruber@chromium.org

Bug: chromium:1255368
Change-Id: If37351e8f5715e23affd21ad2de8a8eaad3ea094
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3204965Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77250}
parent b1de7837
......@@ -112,7 +112,10 @@ RegExpMacroAssemblerARM::RegExpMacroAssemblerARM(Isolate* isolate, Zone* zone,
__ bind(&start_label_); // And then continue from here.
}
RegExpMacroAssemblerARM::~RegExpMacroAssemblerARM() {
RegExpMacroAssemblerARM::~RegExpMacroAssemblerARM() = default;
void RegExpMacroAssemblerARM::AbortedCodeGeneration() {
masm_->AbortedCodeGeneration();
// Unuse labels in case we throw away the assembler without calling GetCode.
entry_label_.Unuse();
start_label_.Unuse();
......@@ -124,7 +127,6 @@ RegExpMacroAssemblerARM::~RegExpMacroAssemblerARM() {
fallback_label_.Unuse();
}
int RegExpMacroAssemblerARM::stack_limit_slack() {
return RegExpStack::kStackLimitSlack;
}
......
......@@ -17,6 +17,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM
RegExpMacroAssemblerARM(Isolate* isolate, Zone* zone, Mode mode,
int registers_to_save);
virtual ~RegExpMacroAssemblerARM();
virtual void AbortedCodeGeneration();
virtual int stack_limit_slack();
virtual void AdvanceCurrentPosition(int by);
virtual void AdvanceRegister(int reg, int by);
......
// 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: --no-regexp-tier-up
const arr = new Array(20000).fill([1]);
const regexp = RegExp(JSON.stringify(arr));
assertThrows(() => regexp.exec(), SyntaxError, /Regular expression too large/);
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