summaryrefslogtreecommitdiff
path: root/src/tools/fuzzing/fuzzing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/fuzzing/fuzzing.cpp')
-rw-r--r--src/tools/fuzzing/fuzzing.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp
index cc64b3b6a..831d80c04 100644
--- a/src/tools/fuzzing/fuzzing.cpp
+++ b/src/tools/fuzzing/fuzzing.cpp
@@ -1969,8 +1969,13 @@ Expression* TranslateToFuzzReader::makeConstBasicRef(Type type) {
assert(wasm.features.hasReferenceTypes());
switch (heapType.getBasic()) {
case HeapType::ext: {
- assert(type.isNullable() && "Cannot handle non-nullable externref");
- return builder.makeRefNull(type);
+ auto null = builder.makeRefNull(HeapType::ext);
+ // TODO: support actual non-nullable externrefs via imported globals or
+ // similar.
+ if (!type.isNullable()) {
+ return builder.makeRefAs(RefAsNonNull, null);
+ }
+ return null;
}
case HeapType::func: {
return makeRefFuncConst(type);