From 67894e4989870807561e6e80ae6e18c1e0e9a4ef Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 11 Nov 2024 15:36:28 -0800 Subject: [wasm64] Fuzzer: Fix type of unimported offsets (#7071) When the fuzzer sees an imported segment, it makes it non-imported (because imported ones would trap when we tried to run them: we don't have the normal runtime they expect). We had hardcoded i32 offets there, which need to be generalized. --- src/tools/fuzzing/fuzzing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/fuzzing/fuzzing.cpp') diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index f4e21d870..cbdbff3ca 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -535,7 +535,7 @@ void TranslateToFuzzReader::finalizeMemory() { // TODO: It would be better to avoid segment overlap so that // MemoryPacking can run. segment->offset = - builder.makeConst(Literal::makeFromInt32(0, Type::i32)); + builder.makeConst(Literal::makeFromInt32(0, memory->addressType)); } } if (auto* offset = segment->offset->dynCast()) { @@ -579,7 +579,7 @@ void TranslateToFuzzReader::finalizeTable() { assert(!wasm.getGlobal(get->name)->imported()); // TODO: the segments must not overlap... segment->offset = - builder.makeConst(Literal::makeFromInt32(0, Type::i32)); + builder.makeConst(Literal::makeFromInt32(0, table->addressType)); } } Address maxOffset = segment->data.size(); -- cgit v1.2.3