diff options
author | Sam Clegg <sbc@chromium.org> | 2022-01-10 14:18:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 14:18:15 -0800 |
commit | 7796031f0ab4fb785fbc4335bdd211421b9e79b6 (patch) | |
tree | 3e38ded3af15f311a075a333b250e91c34c7451e /test | |
parent | c12de34c7d33b3ccf80f117edf78b5346bd00897 (diff) | |
download | binaryen-7796031f0ab4fb785fbc4335bdd211421b9e79b6.tar.gz binaryen-7796031f0ab4fb785fbc4335bdd211421b9e79b6.tar.bz2 binaryen-7796031f0ab4fb785fbc4335bdd211421b9e79b6.zip |
SafeHeap: Avoid instrumenting functions directly called from the "start" (#4439)
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/safe-heap_start-function.txt | 11 | ||||
-rw-r--r-- | test/passes/safe-heap_start-function.wast | 9 |
2 files changed, 17 insertions, 3 deletions
diff --git a/test/passes/safe-heap_start-function.txt b/test/passes/safe-heap_start-function.txt index fc5ef831f..58bb77d44 100644 --- a/test/passes/safe-heap_start-function.txt +++ b/test/passes/safe-heap_start-function.txt @@ -13,7 +13,16 @@ (import "env" "segfault" (func $segfault)) (import "env" "alignfault" (func $alignfault)) (memory $0 1 1) - (start $foo) + (start $mystart) + (func $mystart + (i32.store + (i32.load + (i32.const 42) + ) + (i32.const 43) + ) + (call $foo) + ) (func $foo (i32.store (i32.load diff --git a/test/passes/safe-heap_start-function.wast b/test/passes/safe-heap_start-function.wast index ddc947f7e..7fc2d5201 100644 --- a/test/passes/safe-heap_start-function.wast +++ b/test/passes/safe-heap_start-function.wast @@ -1,11 +1,16 @@ (module (memory 1 1) - (func $foo + (func $mystart ;; should not be modified because its the start function + (i32.store (i32.load (i32.const 42)) (i32.const 43)) + (call $foo) + ) + (func $foo + ;; should not be modified because its called from the start function (i32.store (i32.load (i32.const 1234)) (i32.const 5678)) ) (func $bar (i32.store (i32.load (i32.const 1234)) (i32.const 5678)) ) - (start $foo) + (start $mystart) ) |