summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-04-21 17:04:01 -0700
committerGitHub <noreply@github.com>2022-04-21 17:04:01 -0700
commit6000629ae7cc2962483cd0d7ae4a770c8f2a34a0 (patch)
tree0b4a51277e677c47533590f4fcec6afe72df9c77 /test
parent50d596b3287f19e4ff2f1e1d4a9629968695da73 (diff)
downloadbinaryen-6000629ae7cc2962483cd0d7ae4a770c8f2a34a0.tar.gz
binaryen-6000629ae7cc2962483cd0d7ae4a770c8f2a34a0.tar.bz2
binaryen-6000629ae7cc2962483cd0d7ae4a770c8f2a34a0.zip
[NominalFuzzing] GTO: trap on null ref in removed struct.set (#4607)
When a field has no reads, we remove all its writes, but we did this: (struct.set $foo A B) => (drop A) (drop B) We also need to trap if A, the reference, is null, which this PR fixes, (struct.set $foo A B) => (drop (ref.as_non_null A)) (drop B)
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/gto-removals.wast12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lit/passes/gto-removals.wast b/test/lit/passes/gto-removals.wast
index 92e98ee2a..1d80b24ee 100644
--- a/test/lit/passes/gto-removals.wast
+++ b/test/lit/passes/gto-removals.wast
@@ -29,7 +29,9 @@
;; CHECK: (func $func (type $ref|$struct|_=>_none) (param $x (ref $struct))
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: (ref.as_non_null
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.null func)
@@ -140,7 +142,9 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: (ref.as_non_null
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 0)
@@ -162,7 +166,9 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: (ref.as_non_null
+ ;; CHECK-NEXT: (local.get $x)
+ ;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (i32.const 2)