From 2b512ce7d415d40b461ea264c98c7d98e45b4df0 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 20 Feb 2024 10:49:18 -0800 Subject: StringLowering: Lower nulls in call params (#6317) --- src/passes/StringLowering.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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; -- cgit v1.2.3