diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-10-10 20:38:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 20:38:44 -0700 |
commit | 4507ee5767b62095b29ca3b9c775475400f5423a (patch) | |
tree | ad4e4012bf1248d48ff323f3691b9ac11ea5faf8 /test | |
parent | f841dd1b33e4060de64b92e6c467450d7a1f77d8 (diff) | |
download | binaryen-4507ee5767b62095b29ca3b9c775475400f5423a.tar.gz binaryen-4507ee5767b62095b29ca3b9c775475400f5423a.tar.bz2 binaryen-4507ee5767b62095b29ca3b9c775475400f5423a.zip |
Don't instrument pops in InstrumentLocals (#2378)
`pop` is not a real instruction and automatically generated when reading
binary and deleted when writing binary, so this does not work with
instrumentation.
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/instrument-locals_all-features.txt | 44 | ||||
-rw-r--r-- | test/passes/instrument-locals_all-features.wast | 8 |
2 files changed, 39 insertions, 13 deletions
diff --git a/test/passes/instrument-locals_all-features.txt b/test/passes/instrument-locals_all-features.txt index b4525c52b..57d3d919e 100644 --- a/test/passes/instrument-locals_all-features.txt +++ b/test/passes/instrument-locals_all-features.txt @@ -127,21 +127,29 @@ ) (local.set $a (call $set_anyref - (i32.const 13) + (i32.const 14) (i32.const 4) - (anyref.pop) + (call $get_anyref + (i32.const 13) + (i32.const 4) + (local.get $a) + ) ) ) (local.set $e (call $set_exnref - (i32.const 14) + (i32.const 16) (i32.const 5) - (exnref.pop) + (call $get_exnref + (i32.const 15) + (i32.const 5) + (local.get $e) + ) ) ) (local.set $x (call $set_i32 - (i32.const 15) + (i32.const 17) (i32.const 0) (i32.const 11) ) @@ -151,31 +159,45 @@ ) (local.set $z (call $set_f32 - (i32.const 16) + (i32.const 18) (i32.const 2) (f32.const 33.209999084472656) ) ) (local.set $w (call $set_f64 - (i32.const 17) + (i32.const 19) (i32.const 3) (f64.const 44.321) ) ) (local.set $a (call $set_anyref - (i32.const 18) + (i32.const 21) (i32.const 4) - (anyref.pop) + (call $get_anyref + (i32.const 20) + (i32.const 4) + (local.get $a) + ) ) ) (local.set $e (call $set_exnref - (i32.const 19) + (i32.const 23) (i32.const 5) - (exnref.pop) + (call $get_exnref + (i32.const 22) + (i32.const 5) + (local.get $e) + ) ) ) + (local.set $a + (anyref.pop) + ) + (local.set $e + (exnref.pop) + ) ) ) diff --git a/test/passes/instrument-locals_all-features.wast b/test/passes/instrument-locals_all-features.wast index ddcec39ea..906366557 100644 --- a/test/passes/instrument-locals_all-features.wast +++ b/test/passes/instrument-locals_all-features.wast @@ -25,13 +25,17 @@ (local.set $y (i64.const 2)) (local.set $z (f32.const 3.21)) (local.set $w (f64.const 4.321)) - (local.set $a (anyref.pop)) - (local.set $e (exnref.pop)) + (local.set $a (local.get $a)) + (local.set $e (local.get $e)) (local.set $x (i32.const 11)) (local.set $y (i64.const 22)) (local.set $z (f32.const 33.21)) (local.set $w (f64.const 44.321)) + (local.set $a (local.get $a)) + (local.set $e (local.get $e)) + + ;; Pop instructions should not be instrumented (local.set $a (anyref.pop)) (local.set $e (exnref.pop)) ) |