summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-08-12 09:31:37 -0700
committerGitHub <noreply@github.com>2021-08-12 09:31:37 -0700
commitb84d2cf5491cabdeac565dcd9695d1673037f7e9 (patch)
tree68fc4c43d662c2c7d5baf68c07fa6bcc1cc23058 /src/wasm/wasm-binary.cpp
parent344bfe98b3d4cdb9dac223e9b6b8be7f96332d59 (diff)
downloadbinaryen-b84d2cf5491cabdeac565dcd9695d1673037f7e9.tar.gz
binaryen-b84d2cf5491cabdeac565dcd9695d1673037f7e9.tar.bz2
binaryen-b84d2cf5491cabdeac565dcd9695d1673037f7e9.zip
Fix signed_ field initialization in Load. (#4075)
This was being set in the creation of Loads in the binary reader, but forgotten in the SIMD logic - which ends up creating a Load with type v128, and signed_ was uninitialized. Very hard to test this, but I saw it "break" hash value computation which is how I noticed this. Also initialize the I31 sign field. Now all of them in wasm.h are properly initialized.
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index f58c4f783..ae0e24759 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -4041,12 +4041,6 @@ bool WasmBinaryBuilder::maybeVisitLoad(Expression*& out,
Load* curr;
auto allocate = [&]() {
curr = allocator.alloc<Load>();
- // The signed field does not matter in some cases (where the size of the
- // load is equal to the size of the type, in which case we do not extend),
- // but give it a default value nonetheless, to make hashing and other code
- // simpler, so that they do not need to consider whether the sign matters or
- // not.
- curr->signed_ = false;
};
if (!isAtomic) {
switch (code) {