mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SimplifyCFG: fix try_apply -> apply transformation for indirect error results
Indirect error results must not be included in the final apply arguments which they are not present in the callee.
This commit is contained in:
@@ -242,6 +242,12 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool isArgumentIndexOfIndirectErrorResult(unsigned idx) {
|
||||
unsigned indirectResults = getNumIndirectSILResults();
|
||||
return idx >= indirectResults &&
|
||||
idx < indirectResults + getNumIndirectSILErrorResults();
|
||||
}
|
||||
|
||||
/// Are any SIL results passed as address-typed arguments?
|
||||
bool hasIndirectSILResults() const { return getNumIndirectSILResults() != 0; }
|
||||
bool hasIndirectSILErrorResults() const { return getNumIndirectSILErrorResults() != 0; }
|
||||
|
||||
Reference in New Issue
Block a user