diff options
author | Alon Zakai <azakai@google.com> | 2024-04-24 11:04:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 11:04:14 -0700 |
commit | eb566054dd246c15997c12bb8bb0b0c1b47ed5a5 (patch) | |
tree | b7ec07106c3db3cd7ec0537f8fe759e6903e2582 | |
parent | 589eff8b82ec4d4c53b90f79b73c1e28d6e2dcdf (diff) | |
download | binaryen-eb566054dd246c15997c12bb8bb0b0c1b47ed5a5.tar.gz binaryen-eb566054dd246c15997c12bb8bb0b0c1b47ed5a5.tar.bz2 binaryen-eb566054dd246c15997c12bb8bb0b0c1b47ed5a5.zip |
Fuzzer: Compare strings (#6530)
-rw-r--r-- | src/tools/execution-results.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index 40d844f19..d9fa5cd9b 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -175,17 +175,21 @@ struct ExecutionResults { } bool areEqual(Literal a, Literal b) { - if (a.type.isRef()) { - // Don't compare references. There are several issues here that we can't - // fully handle, see https://github.com/WebAssembly/binaryen/issues/3378, - // but the core issue is that since we optimize assuming a closed world, - // the types and structure of GC data can arbitrarily change after - // optimizations, even in ways that are externally visible from outside - // the module. - // - // TODO: Once we support optimizing under some form of open-world - // assumption, we should be able to check that the types and/or structure - // of GC data passed out of the module does not change. + // Don't compare references. There are several issues here that we can't + // fully handle, see https://github.com/WebAssembly/binaryen/issues/3378, + // but the core issue is that since we optimize assuming a closed world, the + // types and structure of GC data can arbitrarily change after + // optimizations, even in ways that are externally visible from outside + // the module. + // + // We can, however, compare strings as they refer to simple data that has a + // consistent representation (the same reasons as why we can print them in + // printValue(), above). + // + // TODO: Once we support optimizing under some form of open-world + // assumption, we should be able to check that the types and/or structure of + // GC data passed out of the module does not change. + if (a.type.isRef() && !a.type.isString()) { return true; } if (a != b) { |