summaryrefslogtreecommitdiff
path: root/test/passes/simplify-locals_all-features.txt
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-10-21 09:19:49 -0700
committerGitHub <noreply@github.com>2020-10-21 09:19:49 -0700
commitda68e75db7c4ca9c32d5c296499b51858d432c02 (patch)
treecc7afd22e2c007f9112fea3838c644f527f076f9 /test/passes/simplify-locals_all-features.txt
parentb7c452ea1bf0ebce9f8da19e8124c20b4373a009 (diff)
downloadbinaryen-da68e75db7c4ca9c32d5c296499b51858d432c02.tar.gz
binaryen-da68e75db7c4ca9c32d5c296499b51858d432c02.tar.bz2
binaryen-da68e75db7c4ca9c32d5c296499b51858d432c02.zip
SimplifyLocals fuzz fix: Don't be confused by subtype assigns. (#3267)
We checked if the type matches when deciding if two locals are equivalent, but if the type didn't match, we forgot to reset any previously equivalent things. So we thought something was equivalent when it wasn't, see the reduced testcase. Fixes #3266
Diffstat (limited to 'test/passes/simplify-locals_all-features.txt')
-rw-r--r--test/passes/simplify-locals_all-features.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/passes/simplify-locals_all-features.txt b/test/passes/simplify-locals_all-features.txt
index 81fca48ef..a9f056136 100644
--- a/test/passes/simplify-locals_all-features.txt
+++ b/test/passes/simplify-locals_all-features.txt
@@ -2040,3 +2040,21 @@
)
)
)
+(module
+ (type $eqref_i31ref_=>_i32 (func (param eqref i31ref) (result i32)))
+ (export "test" (func $0))
+ (func $0 (param $0 eqref) (param $1 i31ref) (result i32)
+ (local $2 eqref)
+ (local $3 i31ref)
+ (local.set $2
+ (local.get $0)
+ )
+ (local.set $0
+ (local.get $3)
+ )
+ (ref.eq
+ (local.get $2)
+ (local.get $1)
+ )
+ )
+)