diff options
author | Alon Zakai <azakai@google.com> | 2020-11-13 11:14:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-13 11:14:44 -0800 |
commit | 0f49b56029f93c1b54736ed2473d23f457d46894 (patch) | |
tree | 50e6e57a475971827137a0f4aacd27ae257e9489 /src/wasm/wasm.cpp | |
parent | 262bd62777fcde6b930d520e61457699dbb9901e (diff) | |
download | binaryen-0f49b56029f93c1b54736ed2473d23f457d46894.tar.gz binaryen-0f49b56029f93c1b54736ed2473d23f457d46894.tar.bz2 binaryen-0f49b56029f93c1b54736ed2473d23f457d46894.zip |
Fix a hashing regression from #3332 (#3349)
We used to check if a load's sign matters before hashing it. If the load does
not extend, then the sign doesn't matter, and we ignored the value there. It
turns out that value could be garbage, as we didn't assign it in the binary
reader, if it wasn't relevant. In the rewrite this was missed, and actually it's
not really possible to do, since we have just a macro for the field, but not the
object it is on - which there may be more than one.
To fix this, just always assign the field. This is simpler anyhow, and avoids
confusion not just here but probably when debugging.
The testcase here is reduced from the fuzzer, and is not a 100% guarantee
to catch a read of uninitialized memory, but it can't hurt, and with ASan it
may be pretty consistent.
Diffstat (limited to 'src/wasm/wasm.cpp')
0 files changed, 0 insertions, 0 deletions