diff options
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 5e316d4f4..6568c907e 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -1216,6 +1216,26 @@ void StringEq::finalize() { } } +void StringAs::finalize() { + if (ref->type == Type::unreachable) { + type = Type::unreachable; + } else { + switch (op) { + case StringAsWTF8: + type = Type(HeapType::stringview_wtf8, NonNullable); + break; + case StringAsWTF16: + type = Type(HeapType::stringview_wtf16, NonNullable); + break; + case StringAsIter: + type = Type(HeapType::stringview_iter, NonNullable); + break; + default: + WASM_UNREACHABLE("bad string.as"); + } + } +} + size_t Function::getNumParams() { return getParams().size(); } size_t Function::getNumVars() { return vars.size(); } |