diff options
author | Alon Zakai <azakai@google.com> | 2024-02-20 10:49:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 10:49:18 -0800 |
commit | 2b512ce7d415d40b461ea264c98c7d98e45b4df0 (patch) | |
tree | 85c5f0c0ba18d5a5d54a4dbd13d99592666b720e /src | |
parent | feb8f24128c0c3bd53862b2f39acc5116f8ae87e (diff) | |
download | binaryen-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.cpp | 10 |
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; |