summaryrefslogtreecommitdiff
path: root/src/wasm-stack.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-stack.h')
-rw-r--r--src/wasm-stack.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wasm-stack.h b/src/wasm-stack.h
index e51e5eb91..85003f9ea 100644
--- a/src/wasm-stack.h
+++ b/src/wasm-stack.h
@@ -164,6 +164,21 @@ private:
// and StringSliceWTF if their non-string operands are already LocalGets.
// Record those LocalGets here.
std::unordered_set<LocalGet*> deferredGets;
+
+ // Track which br_ifs need handling of their output values, which is the case
+ // when they have a value that is more refined than the wasm type system
+ // allows atm (and they are not dropped, in which case the type would not
+ // matter). See https://github.com/WebAssembly/binaryen/pull/6390 for more on
+ // the difference. As a result of the difference, we will insert extra casts
+ // to ensure validation in the wasm spec. The wasm spec will hopefully improve
+ // to use the more refined type as well, which would remove the need for this
+ // hack.
+ //
+ // Each br_if present as a key here is mapped to the unrefined type for it.
+ // That is, the br_if has a type in Binaryen IR that is too refined, and the
+ // map contains the unrefined one (which we need to know the local types, as
+ // we'll stash the unrefined values and then cast them).
+ std::unordered_map<Break*, Type> brIfsNeedingHandling;
};
// Takes binaryen IR and converts it to something else (binary or stack IR)