Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/wasm/wasm-stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,14 @@ void BinaryInstWriter::visitRefAs(RefAs* curr) {
}

void BinaryInstWriter::visitStringNew(StringNew* curr) {
if (curr->ptr->type.isNull()) {
// This is a bottom type, so this is an array-receiving operation that does
// not receive an array. The spec allows this, but V8 does not, see
// https://github.com/WebAssembly/stringref/issues/66
// For now, just emit an unreachable here as this will definitely trap.
emitUnreachable();
return;
}
o << int8_t(BinaryConsts::GCPrefix);
switch (curr->op) {
case StringNewUTF8:
Expand Down Expand Up @@ -2371,6 +2379,11 @@ void BinaryInstWriter::visitStringMeasure(StringMeasure* curr) {
}

void BinaryInstWriter::visitStringEncode(StringEncode* curr) {
if (curr->ptr->type.isNull()) {
// See visitStringNew.
emitUnreachable();
return;
}
o << int8_t(BinaryConsts::GCPrefix);
switch (curr->op) {
case StringEncodeUTF8:
Expand Down