diff options
author | Alon Zakai <azakai@google.com> | 2022-04-21 07:16:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 14:16:28 +0000 |
commit | 7b6f0d889848fb8031e0d3f2bc801e943ab787e0 (patch) | |
tree | 8c7acbc51e388cc72e53167e4887aa028a687d13 /src | |
parent | 16fc4cb87558557ca8d608e8f818fc1fdfe95983 (diff) | |
download | binaryen-7b6f0d889848fb8031e0d3f2bc801e943ab787e0.tar.gz binaryen-7b6f0d889848fb8031e0d3f2bc801e943ab787e0.tar.bz2 binaryen-7b6f0d889848fb8031e0d3f2bc801e943ab787e0.zip |
[NominalFuzzing] Don't compare nominal types in the fuzzer (#4603)
The same module will have a different type after some transformations, even
though that is not observable, like --roundtrip. Basically, we should not be
comparing types between separate modules, which is what the fuzzer does.
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/execution-results.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index 5f2e772f0..10e243287 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -151,9 +151,14 @@ struct ExecutionResults { bool areEqual(Literal a, Literal b) { // We allow nulls to have different types (as they compare equal regardless) // but anything else must have an identical type. - if (a.type != b.type && !(a.isNull() && b.isNull())) { - std::cout << "types not identical! " << a << " != " << b << '\n'; - return false; + // We cannot do this in nominal typing, however, as different modules will + // have different types in general. We could perhaps compare the entire + // graph structurally TODO + if (getTypeSystem() != TypeSystem::Nominal) { + if (a.type != b.type && !(a.isNull() && b.isNull())) { + std::cout << "types not identical! " << a << " != " << b << '\n'; + return false; + } } if (a.type.isRef()) { // Don't compare references - only their types. There are several issues |