summaryrefslogtreecommitdiff
path: root/src/wasm/wasm.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-07-07 10:32:57 -0700
committerGitHub <noreply@github.com>2022-07-07 10:32:57 -0700
commitdc73f07807400eb48b8c4bc173bae37f188fc90b (patch)
treeed9672cb7847c6d9d33657151dc76fa4cb519ff3 /src/wasm/wasm.cpp
parent876638f8fb5bfc8b264eddc6c0c0d54ed40d0095 (diff)
downloadbinaryen-dc73f07807400eb48b8c4bc173bae37f188fc90b.tar.gz
binaryen-dc73f07807400eb48b8c4bc173bae37f188fc90b.tar.bz2
binaryen-dc73f07807400eb48b8c4bc173bae37f188fc90b.zip
[Strings] string.measure (#4775)
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r--src/wasm/wasm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 86eed184f..749a44339 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -1184,6 +1184,14 @@ void StringNew::finalize() {
void StringConst::finalize() { type = Type(HeapType::string, NonNullable); }
+void StringMeasure::finalize() {
+ if (ref->type == Type::unreachable) {
+ type = Type::unreachable;
+ } else {
+ type = Type::i32;
+ }
+}
+
size_t Function::getNumParams() { return getParams().size(); }
size_t Function::getNumVars() { return vars.size(); }