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 /src/tools/wasm-ctor-eval.cpp | |
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 'src/tools/wasm-ctor-eval.cpp')
-rw-r--r-- | src/tools/wasm-ctor-eval.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp index 6662dd176..2f7707853 100644 --- a/src/tools/wasm-ctor-eval.cpp +++ b/src/tools/wasm-ctor-eval.cpp @@ -312,6 +312,10 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface { throw FailToEvalException(std::string("trap: ") + why); } + void hostLimit(const char* why) override { + throw FailToEvalException(std::string("trap: ") + why); + } + void throwException(const WasmException& exn) override { std::stringstream ss; ss << "exception thrown: " << exn; |