diff options
author | Max Graey <maxgraey@gmail.com> | 2020-10-28 20:52:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-28 11:52:24 -0700 |
commit | 8cd3ad23543b1e6d0c8e5f8a1563ca5f87960645 (patch) | |
tree | bb76dbca3a1636111efdc2de9a0e6bb9c02fabd3 /test | |
parent | 5f7d2636e926e0061e4f07dfd5c864d32a7f6144 (diff) | |
download | binaryen-8cd3ad23543b1e6d0c8e5f8a1563ca5f87960645.tar.gz binaryen-8cd3ad23543b1e6d0c8e5f8a1563ca5f87960645.tar.bz2 binaryen-8cd3ad23543b1e6d0c8e5f8a1563ca5f87960645.zip |
Fix pow2 util and avoid pow2 for left shifting in ZeroRemover (#3293)
Fixes a fuzz bug that was triggered by
https://github.com/WebAssembly/binaryen/pull/3015#issuecomment-718001620
but was actually a pre-existing bug in pow2, that that PR just happened
to uncover.
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions_all-features.txt | 11 | ||||
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 15 |
2 files changed, 25 insertions, 1 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index 3e792cd9a..15f0eea86 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -1,7 +1,7 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (type $i32_i64_=>_none (func (param i32 i64))) (type $none_=>_none (func)) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) @@ -2362,6 +2362,15 @@ ) ) ) + (func $zero-ops-64-special (result i32) + (return + (i32.wrap_i64 + (i64.popcnt + (i64.const 7377) + ) + ) + ) + ) (func $sign-ext-1-and-ne (result i32) (i32.ne (i32.and diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index cdd203fa4..02f55b20c 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -2683,6 +2683,21 @@ ) ) ) + (func $zero-ops-64-special (result i32) + (return + (i32.wrap_i64 + (i64.popcnt + (i64.sub + (i64.shl + (i64.const 4294783828) + (i64.const 17179869183) + ) + (i64.const -7377) + ) + ) + ) + ) + ) (func $sign-ext-1-and-ne (result i32) (select (i32.ne |