summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-08-06 13:23:27 -0400
committerGitHub <noreply@github.com>2024-08-06 10:23:27 -0700
commit1c3578c7e28d9fced48a756546c07a2acb26bdcc (patch)
tree00ea07e13fe4ab61f756e6f75639cdd8fa0efaf7 /src/tools
parentbae0da03af8f4f240d659d016b6e4ee998551059 (diff)
downloadbinaryen-1c3578c7e28d9fced48a756546c07a2acb26bdcc.tar.gz
binaryen-1c3578c7e28d9fced48a756546c07a2acb26bdcc.tar.bz2
binaryen-1c3578c7e28d9fced48a756546c07a2acb26bdcc.zip
Fix sharedness bug in inhabitable type fuzzer (#6807)
The code for collecting inhabitable types incorrectly considered shared, non-nullable externrefs to be inhabitable, which disagreed with the code for rewriting types to be inhabitable, which was correct, causing the type fuzzer to report an error.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/fuzzing/heap-types.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/fuzzing/heap-types.cpp b/src/tools/fuzzing/heap-types.cpp
index 7eaf23701..e4d54ae07 100644
--- a/src/tools/fuzzing/heap-types.cpp
+++ b/src/tools/fuzzing/heap-types.cpp
@@ -1031,7 +1031,8 @@ bool isUninhabitable(Type type,
std::unordered_set<HeapType>& visited,
std::unordered_set<HeapType>& visiting) {
if (type.isRef() && type.isNonNullable()) {
- if (type.getHeapType().isBottom() || type.getHeapType() == HeapType::ext) {
+ if (type.getHeapType().isBottom() ||
+ type.getHeapType().isMaybeShared(HeapType::ext)) {
return true;
}
return isUninhabitable(type.getHeapType(), visited, visiting);