mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
EagerSpecializer: fix a SIL verifier crash
When inserting type checks for pre-specialized functions, the existing return-block can only be re-used if it has no arguments. Otherwise we are creating an argument-less branch to a block with arguments. rdar://124638266
This commit is contained in:
@@ -72,6 +72,9 @@ static bool isTrivialReturnBlock(SILBasicBlock *RetBB) {
|
||||
// % = tuple ()
|
||||
// return % : $()
|
||||
if (RetOperand->getType().isVoid()) {
|
||||
if (!RetBB->args_empty())
|
||||
return false;
|
||||
|
||||
auto *TupleI = dyn_cast<TupleInst>(RetBB->begin());
|
||||
if (!TupleI || !TupleI->getType().isVoid())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user