summaryrefslogtreecommitdiff
path: root/test/passes/precompute_coalesce-locals_vacuum.wast
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-05-08 14:05:05 -0700
committerGitHub <noreply@github.com>2017-05-08 14:05:05 -0700
commitc72d10b7ffbc3083cf52de001407f89935422112 (patch)
tree543acd9eb2e3e4f16e51e5edd78f39251636d100 /test/passes/precompute_coalesce-locals_vacuum.wast
parent0b8acfc0139652d1c0f284c7650812a309574586 (diff)
downloadbinaryen-c72d10b7ffbc3083cf52de001407f89935422112.tar.gz
binaryen-c72d10b7ffbc3083cf52de001407f89935422112.tar.bz2
binaryen-c72d10b7ffbc3083cf52de001407f89935422112.zip
fix an afl-fuzz bug where precompute alters a br to remove its condition, but does not properly modify the type (#1000)
Diffstat (limited to 'test/passes/precompute_coalesce-locals_vacuum.wast')
-rw-r--r--test/passes/precompute_coalesce-locals_vacuum.wast20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/passes/precompute_coalesce-locals_vacuum.wast b/test/passes/precompute_coalesce-locals_vacuum.wast
new file mode 100644
index 000000000..d7502989f
--- /dev/null
+++ b/test/passes/precompute_coalesce-locals_vacuum.wast
@@ -0,0 +1,20 @@
+(module
+ (func $nested-br_if-value (param $var$0 i32) (result i32)
+ (local $1 i32)
+ (local $2 i32)
+ (loop $label$0 i32
+ (drop
+ (i32.const 2)
+ )
+ (block i32
+ (set_local $2
+ (i32.const 4)
+ )
+ (br_if $label$0 ;; precomputing this into a br must change the type
+ (i32.const 1)
+ )
+ (get_local $2)
+ )
+ )
+ )
+)