diff options
author | Alon Zakai <azakai@google.com> | 2022-01-11 10:53:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-11 10:53:04 -0800 |
commit | 1e7e248d890d27a40f3dc287bd82834930f81e5c (patch) | |
tree | a3d16247e0c1d32c396279ac8bac2672877bc796 /test | |
parent | 8faada66b4b175596db39a8762b7bdc687f101cf (diff) | |
download | binaryen-1e7e248d890d27a40f3dc287bd82834930f81e5c.tar.gz binaryen-1e7e248d890d27a40f3dc287bd82834930f81e5c.tar.bz2 binaryen-1e7e248d890d27a40f3dc287bd82834930f81e5c.zip |
[ctor-eval] Fix evalling of overlapping table segments (#4440)
Diffstat (limited to 'test')
-rw-r--r-- | test/ctor-eval/overlapping-segments.wast | 27 | ||||
-rw-r--r-- | test/ctor-eval/overlapping-segments.wast.ctors | 1 | ||||
-rw-r--r-- | test/ctor-eval/overlapping-segments.wast.out | 21 |
3 files changed, 49 insertions, 0 deletions
diff --git a/test/ctor-eval/overlapping-segments.wast b/test/ctor-eval/overlapping-segments.wast new file mode 100644 index 000000000..bdd6ef905 --- /dev/null +++ b/test/ctor-eval/overlapping-segments.wast @@ -0,0 +1,27 @@ +(module + (type $none_=>_i32 (func (result i32))) + + (table $0 46 funcref) + (elem $0 (i32.const 9) $1) + (elem $1 (i32.const 9) $0) + + (export "test1" (func $2)) + + (func $0 (result i32) + (unreachable) + ) + (func $1 (result i32) + (i32.const 65) + ) + (func $2 + (drop + (call_indirect (type $none_=>_i32) + ;; Calling the item at index $9 should call $0, which appears in the + ;; last of the overlapping segments. That function traps, which stops + ;; us from evalling anything here. + (i32.const 9) + ) + ) + ) +) + diff --git a/test/ctor-eval/overlapping-segments.wast.ctors b/test/ctor-eval/overlapping-segments.wast.ctors new file mode 100644 index 000000000..a5bce3fd2 --- /dev/null +++ b/test/ctor-eval/overlapping-segments.wast.ctors @@ -0,0 +1 @@ +test1 diff --git a/test/ctor-eval/overlapping-segments.wast.out b/test/ctor-eval/overlapping-segments.wast.out new file mode 100644 index 000000000..5a5447391 --- /dev/null +++ b/test/ctor-eval/overlapping-segments.wast.out @@ -0,0 +1,21 @@ +(module + (type $none_=>_i32 (func (result i32))) + (type $none_=>_none (func)) + (table $0 46 funcref) + (elem $0 (i32.const 9) $1) + (elem $1 (i32.const 9) $0) + (export "test1" (func $2)) + (func $0 (result i32) + (unreachable) + ) + (func $1 (result i32) + (i32.const 65) + ) + (func $2 + (drop + (call_indirect $0 (type $none_=>_i32) + (i32.const 9) + ) + ) + ) +) |