summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-02-20 10:49:18 -0800
committerGitHub <noreply@github.com>2024-02-20 10:49:18 -0800
commit2b512ce7d415d40b461ea264c98c7d98e45b4df0 (patch)
tree85c5f0c0ba18d5a5d54a4dbd13d99592666b720e /src
parentfeb8f24128c0c3bd53862b2f39acc5116f8ae87e (diff)
downloadbinaryen-2b512ce7d415d40b461ea264c98c7d98e45b4df0.tar.gz
binaryen-2b512ce7d415d40b461ea264c98c7d98e45b4df0.tar.bz2
binaryen-2b512ce7d415d40b461ea264c98c7d98e45b4df0.zip
StringLowering: Lower nulls in call params (#6317)
Diffstat (limited to 'src')
-rw-r--r--src/passes/StringLowering.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/passes/StringLowering.cpp b/src/passes/StringLowering.cpp
index 85e75f705..d92a151c7 100644
--- a/src/passes/StringLowering.cpp
+++ b/src/passes/StringLowering.cpp
@@ -456,6 +456,16 @@ struct StringLowering : public StringGathering {
}
}
+ void visitCall(Call* curr) {
+ auto targetSig =
+ getModule()->getFunction(curr->target)->type.getSignature();
+ for (Index i = 0; i < curr->operands.size(); i++) {
+ if (isExt(targetSig.params[i])) {
+ ensureNullIsExt(curr->operands[i]);
+ }
+ }
+ }
+
void visitStructNew(StructNew* curr) {
if (curr->type == Type::unreachable || curr->operands.empty()) {
return;