Skip to content

Commit

Permalink
Fuzzer: Work around the lack of wtf8/iter support (WebAssembly#6445)
Browse files Browse the repository at this point in the history
We only have interpreter support for wtf16, so we should not emit operations
on the other types, as the interpreter will error.
  • Loading branch information
kripken authored Mar 27, 2024
1 parent 869fefd commit 3d97d78
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/tools/fuzzing/fuzzing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2639,15 +2639,16 @@ Expression* TranslateToFuzzReader::makeBasicRef(Type type) {
String::convertWTF8ToWTF16(wtf16, wtf8.str());
return builder.makeStringConst(wtf16.str());
}
case HeapType::stringview_wtf8:
return builder.makeStringAs(
StringAsWTF8, makeBasicRef(Type(HeapType::string, NonNullable)));
case HeapType::stringview_wtf16:
// We fully support wtf16 strings.
return builder.makeStringAs(
StringAsWTF16, makeBasicRef(Type(HeapType::string, NonNullable)));
case HeapType::stringview_wtf8:
case HeapType::stringview_iter:
return builder.makeStringAs(
StringAsIter, makeBasicRef(Type(HeapType::string, NonNullable)));
// We do not have interpreter support for wtf8 and iter, so emit something
// that does not return, with a block that casts to the type the parent
// expects.
return builder.makeBlock({_makeunreachable()}, type);
case HeapType::none:
case HeapType::noext:
case HeapType::nofunc:
Expand Down

0 comments on commit 3d97d78

Please sign in to comment.