From 521679172e4b5fde6668411a33e346eeb8cefa2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20T=C3=AEmbur?= Date: Tue, 16 Nov 2021 15:27:54 +0000 Subject: [PATCH] [fuzzer] Use recursion scope only for nullable references in GenerateRef MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use recursion scope only for nullable references in the GenerateRef function. We declare the recursion scope as an optional and only initialize it if the reference type is nullable. Bug: v8:11954, chromium:1270126 Change-Id: I1548290cc9d48167f6fd56ff653744d472f65635 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3284894 Reviewed-by: Thibaud Michaud Reviewed-by: Manos Koukoutos Commit-Queue: Maria Tîmbur Cr-Commit-Position: refs/heads/main@{#77943} --- test/fuzzer/wasm-compile.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/fuzzer/wasm-compile.cc b/test/fuzzer/wasm-compile.cc index ac894e98d2..6f25275d7a 100644 --- a/test/fuzzer/wasm-compile.cc +++ b/test/fuzzer/wasm-compile.cc @@ -2065,7 +2065,11 @@ void WasmGenerator::Generate(ValueType type, DataRange* data) { void WasmGenerator::GenerateRef(HeapType type, DataRange* data, Nullability nullability) { - GeneratorRecursionScope rec_scope(this); + base::Optional rec_scope; + if (nullability) { + rec_scope.emplace(this); + } + if (recursion_limit_reached() || data->size() == 0) { if (nullability == kNullable) { ref_null(type, data);