summaryrefslogtreecommitdiff
path: root/src/passes/SSAify.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-03-29 13:59:41 -0700
committerGitHub <noreply@github.com>2021-03-29 13:59:41 -0700
commit244f886cb2f1d9c5dddbf2dea5d47e6b0a434c5d (patch)
tree684e65be34545d6fc304f5b65b4294ff1512023f /src/passes/SSAify.cpp
parentbac5b8195dd8bf6cd105559a04bb0e069aaddf97 (diff)
downloadbinaryen-244f886cb2f1d9c5dddbf2dea5d47e6b0a434c5d.tar.gz
binaryen-244f886cb2f1d9c5dddbf2dea5d47e6b0a434c5d.tar.bz2
binaryen-244f886cb2f1d9c5dddbf2dea5d47e6b0a434c5d.zip
[Wasm GC] Fix SSA pass on non-nullable parameters (#3745)
If such a parameter is written to then we create a new local for each such write, and must handle non-nullability of those new locals.
Diffstat (limited to 'src/passes/SSAify.cpp')
-rw-r--r--src/passes/SSAify.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/passes/SSAify.cpp b/src/passes/SSAify.cpp
index a0bdb4152..843015936 100644
--- a/src/passes/SSAify.cpp
+++ b/src/passes/SSAify.cpp
@@ -53,6 +53,7 @@
#include "ir/find_all.h"
#include "ir/literal-utils.h"
#include "ir/local-graph.h"
+#include "ir/type-updating.h"
#include "pass.h"
#include "support/permutations.h"
#include "wasm-builder.h"
@@ -98,6 +99,8 @@ struct SSAify : public Pass {
computeGetsAndPhis(graph);
// add prepends to function
addPrepends();
+ // Handle non-nullability in new locals we added.
+ TypeUpdating::handleNonNullableLocals(func, *module);
}
void createNewIndexes(LocalGraph& graph) {