File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,8 @@ class SILFunctionArgument : public SILArgument {
433
433
434
434
bool isIndirectResult () const ;
435
435
436
+ bool isIndirectErrorResult () const ;
437
+
436
438
SILArgumentConvention getArgumentConvention () const ;
437
439
438
440
// / Given that this is an entry block argument, and given that it does
Original file line number Diff line number Diff line change @@ -64,6 +64,14 @@ bool SILFunctionArgument::isIndirectResult() const {
64
64
return getIndex () < numIndirectResults;
65
65
}
66
66
67
+ bool SILFunctionArgument::isIndirectErrorResult () const {
68
+ auto numIndirectResults =
69
+ getFunction ()->getConventions ().getNumIndirectSILResults ();
70
+ auto numIndirectErrorResults =
71
+ getFunction ()->getConventions ().getNumIndirectSILErrorResults ();
72
+ return getIndex () < numIndirectResults + numIndirectErrorResults;
73
+ }
74
+
67
75
SILArgumentConvention SILFunctionArgument::getArgumentConvention () const {
68
76
return getFunction ()->getConventions ().getSILArgumentConvention (getIndex ());
69
77
}
Original file line number Diff line number Diff line change @@ -563,7 +563,12 @@ void MemoryLifetimeVerifier::checkFunction(BitDataflow &dataFlow) {
563
563
locations.setBits (expectedThrowBits, funcArg);
564
564
break ;
565
565
case SILArgumentConvention::Indirect_Out:
566
- locations.setBits (expectedReturnBits, funcArg);
566
+ if (funcArg->isIndirectErrorResult ()) {
567
+ locations.setBits (expectedThrowBits, funcArg);
568
+ } else {
569
+ assert (funcArg->isIndirectResult ());
570
+ locations.setBits (expectedReturnBits, funcArg);
571
+ }
567
572
break ;
568
573
default :
569
574
break ;
You can’t perform that action at this time.
0 commit comments