diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/execution-results.h | 7 | ||||
-rw-r--r-- | src/tools/fuzzing/fuzzing.cpp | 3 | ||||
-rw-r--r-- | src/tools/wasm-ctor-eval.cpp | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index d9fa5cd9b..31c572e65 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -148,7 +148,8 @@ struct ExecutionResults { // simple and stable internal structures that optimizations will not alter. auto type = value.type; if (type.isRef()) { - if (type.isString() || type.getHeapType() == HeapType::i31) { + if (type.getHeapType().isMaybeShared(HeapType::string) || + type.getHeapType().isMaybeShared(HeapType::i31)) { std::cout << value << '\n'; } else if (value.isNull()) { std::cout << "null\n"; @@ -189,7 +190,9 @@ struct ExecutionResults { // 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()) { + if (a.type.isRef() && + !a.type.getHeapType().isMaybeShared(HeapType::string) && + !a.type.getHeapType().isMaybeShared(HeapType::i31)) { return true; } if (a != b) { diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 2aff7146e..138831860 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -2536,7 +2536,8 @@ Expression* TranslateToFuzzReader::makeConst(Type type) { if (type.isNullable() && oneIn(8)) { return builder.makeRefNull(type.getHeapType()); } - if (type.getHeapType().isString()) { + if (type.getHeapType().isMaybeShared(HeapType::string)) { + assert(!type.getHeapType().isShared() && "TODO: shared strings"); return makeStringConst(); } if (type.getHeapType().isBasic()) { diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp index df4e7a9bf..11fee72fb 100644 --- a/src/tools/wasm-ctor-eval.cpp +++ b/src/tools/wasm-ctor-eval.cpp @@ -841,7 +841,8 @@ public: // externalized i31s) can be handled by the general makeConstantExpression // logic (which knows how to handle externalization, for i31s; and it also // can handle string constants). - if (!value.isData() || value.type.getHeapType().isString()) { + if (!value.isData() || + value.type.getHeapType().isMaybeShared(HeapType::string)) { return builder.makeConstantExpression(original); } |