Skip to content

Commit 5c31339

Browse files
committed
[AddressLowering] Loosen assert for partial_apply.
Full apply instructions have the same number of arguments as the callee has parameters. Partial apply instructions have some number less than or equal to the number of callee parameters.
1 parent d1fcc52 commit 5c31339

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,8 +2190,11 @@ bool CallArgRewriter::rewriteArguments() {
21902190
bool changed = false;
21912191

21922192
auto origConv = apply.getSubstCalleeConv();
2193-
assert(apply.getNumArguments() == origConv.getNumParameters() &&
2194-
"results should not yet be rewritten");
2193+
assert((apply.getNumArguments() == origConv.getNumParameters() &&
2194+
apply.asFullApplySite()) ||
2195+
(apply.getNumArguments() <= origConv.getNumParameters() &&
2196+
!apply.asFullApplySite()) &&
2197+
"results should not yet be rewritten");
21952198

21962199
for (unsigned argIdx = apply.getCalleeArgIndexOfFirstAppliedArg(),
21972200
endArgIdx = argIdx + apply.getNumArguments();

0 commit comments

Comments
 (0)