diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-03-19 12:56:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 12:56:07 -0700 |
commit | 9c9b78db2e6ce178cc0c546d59aacaa4c72c001b (patch) | |
tree | 4b130209b6641f47304299c311a36f07caaca795 /test | |
parent | c52f23608e33ab972cfa187409e8c78793103d4b (diff) | |
download | binaryen-9c9b78db2e6ce178cc0c546d59aacaa4c72c001b.tar.gz binaryen-9c9b78db2e6ce178cc0c546d59aacaa4c72c001b.tar.bz2 binaryen-9c9b78db2e6ce178cc0c546d59aacaa4c72c001b.zip |
fix a fuzz bug in fpcast-emu: if the call_indirect we are modifying is unreachable, the modified version is as well (#1481)
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/fpcast-emu.txt | 37 | ||||
-rw-r--r-- | test/passes/fpcast-emu.wast | 22 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test/passes/fpcast-emu.txt b/test/passes/fpcast-emu.txt index 94b92ad17..b1560517c 100644 --- a/test/passes/fpcast-emu.txt +++ b/test/passes/fpcast-emu.txt @@ -292,3 +292,40 @@ ) ) ) +(module + (type $0 (func (param i64))) + (type $1 (func (param f32) (result i64))) + (type $FUNCSIG$jjjjjjjjjjjjjjjj (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64))) + (global $global$0 (mut i32) (i32.const 10)) + (table 42 42 anyfunc) + (export "func_106" (func $0)) + (func $0 (; 0 ;) (type $1) (param $0 f32) (result i64) + (block $label$1 (result i64) + (loop $label$2 + (set_global $global$0 + (i32.const 0) + ) + (call_indirect (type $FUNCSIG$jjjjjjjjjjjjjjjj) + (br $label$1 + (i64.const 4294967295) + ) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i64.const 0) + (i32.const 18) + ) + ) + ) + ) +) diff --git a/test/passes/fpcast-emu.wast b/test/passes/fpcast-emu.wast index cef0d0deb..654cf64e1 100644 --- a/test/passes/fpcast-emu.wast +++ b/test/passes/fpcast-emu.wast @@ -45,4 +45,26 @@ ) ) ) +(module + (type $0 (func (param i64))) + (type $1 (func (param f32) (result i64))) + (global $global$0 (mut i32) (i32.const 10)) + (table 42 42 anyfunc) + (export "func_106" (func $0)) + (func $0 (; 0 ;) (type $1) (param $0 f32) (result i64) + (block $label$1 (result i64) + (loop $label$2 + (set_global $global$0 + (i32.const 0) + ) + (call_indirect (type $0) + (br $label$1 + (i64.const 4294967295) + ) + (i32.const 18) + ) + ) + ) + ) +) |