diff options
author | Alon Zakai <azakai@google.com> | 2021-04-12 18:37:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 18:37:48 -0700 |
commit | b0af95200a37d76eccf285dcb45b4ed6162212d0 (patch) | |
tree | 3633c42ad4935b06f2fe88a8e9901b9d0b08d774 /test/passes/Oz_fuzz-exec_all-features.wast | |
parent | c9aa77c3f6452154526456497731da1bc8e7d896 (diff) | |
download | binaryen-b0af95200a37d76eccf285dcb45b4ed6162212d0.tar.gz binaryen-b0af95200a37d76eccf285dcb45b4ed6162212d0.tar.bz2 binaryen-b0af95200a37d76eccf285dcb45b4ed6162212d0.zip |
Fuzzer: Distinguish traps from host limitations (#3801)
Host limitations are arbitrary and can be modified by optimizations, so
ignore them. For example, if the optimizer removes allocations then a
host limit on an allocation error may vanish. Or, an optimization that
removes recursion and replaces it with a loop may avoid a host limit
on call depth (that is not done currently, but might some day).
This removes a class of annoying false positives in the fuzzer.
Diffstat (limited to 'test/passes/Oz_fuzz-exec_all-features.wast')
-rw-r--r-- | test/passes/Oz_fuzz-exec_all-features.wast | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/passes/Oz_fuzz-exec_all-features.wast b/test/passes/Oz_fuzz-exec_all-features.wast index 4092f6b34..c88133c3a 100644 --- a/test/passes/Oz_fuzz-exec_all-features.wast +++ b/test/passes/Oz_fuzz-exec_all-features.wast @@ -240,3 +240,18 @@ ) ) ) +(module + (type $[mut:i8] (array (mut i8))) + (func "foo" (result i32) + ;; before opts this will trap on failing to allocate -1 >>> 0 bytes. after + ;; opts the unused value is removed so there is no trap, and a value is + ;; returned, which should not confuse the fuzzer. + (drop + (array.new_default_with_rtt $[mut:i8] + (i32.const -1) + (rtt.canon $[mut:i8]) + ) + ) + (i32.const 0) + ) +) |