diff options
author | Alon Zakai <azakai@google.com> | 2024-11-11 15:36:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-11 15:36:28 -0800 |
commit | 67894e4989870807561e6e80ae6e18c1e0e9a4ef (patch) | |
tree | 4069f379f8d94a325df810673f45667a04c77949 | |
parent | f6cfc5647259c12036f58f0a3b6b3cfc83e4b914 (diff) | |
download | binaryen-67894e4989870807561e6e80ae6e18c1e0e9a4ef.tar.gz binaryen-67894e4989870807561e6e80ae6e18c1e0e9a4ef.tar.bz2 binaryen-67894e4989870807561e6e80ae6e18c1e0e9a4ef.zip |
[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.
-rw-r--r-- | src/tools/fuzzing/fuzzing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<Const>()) { @@ -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(); |