diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-09-13 06:11:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-13 06:11:17 +0200 |
commit | 643facd9bf6af1792db473e73e16983df940106f (patch) | |
tree | 5e02e09c480509847b6ba24a9f84855b6b9fb337 /src/tools | |
parent | 0c53fb5d84afe32bfdf13231908aad760cb1d89d (diff) | |
download | binaryen-643facd9bf6af1792db473e73e16983df940106f.tar.gz binaryen-643facd9bf6af1792db473e73e16983df940106f.tar.bz2 binaryen-643facd9bf6af1792db473e73e16983df940106f.zip |
Fix RefNull issues (#3123)
* ExpressionAnalyzer: Fix `ref.null ht` equality check to include `ht`.
* Precompute: Fix `ref.null ht` expression reuse to also update `ht`.
* Fuzzing: Fix `ref.null func` becoming canonicalized to `ref.func $funcref`
when evaluating execution results, by adding a check for `isNull`.
* Fuzzing: Print actual and expected execution results when aborting.
* Tests: Update `if-arms-subtype` test in `optimize-instructions` to check
that identical `if` arms become folded while not identical arms are kept.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/execution-results.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index c41b0c208..0881163f1 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -73,7 +73,7 @@ struct ExecutionResults { // change (after duplicate function elimination or roundtripping) // while the function contents are still the same for (Literal& val : ret) { - if (val.type == Type::funcref) { + if (val.type == Type::funcref && !val.isNull()) { val = Literal::makeFunc(Name("funcref")); } } @@ -112,7 +112,8 @@ struct ExecutionResults { } std::cout << "[fuzz-exec] comparing " << name << '\n'; if (results[name] != other.results[name]) { - std::cout << "not identical!\n"; + std::cout << "not identical! " << results[name] + << " != " << other.results[name] << "\n"; return false; } } |