[SIL] Fix bridged begin_apply results.

The `yield_once_2` adds an extra result at the end, the deallocation.
Fix the indexing for the token and yielded results.
This commit is contained in:
Nate Chandler
2025-04-04 18:06:37 -07:00
parent 1b2f8c3a19
commit b7ca5672c5
4 changed files with 26 additions and 2 deletions

View File

@@ -779,6 +779,7 @@ struct BridgedInstruction {
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedSILTypeArray AllocRefInstBase_getTailAllocatedTypes() const;
BRIDGED_INLINE bool AllocRefDynamicInst_isDynamicTypeDeinitAndSizeKnownEquivalentToBaseType() const;
BRIDGED_INLINE SwiftInt BeginApplyInst_numArguments() const;
BRIDGED_INLINE bool BeginApplyInst_isCalleeAllocated() const;
BRIDGED_INLINE SwiftInt TryApplyInst_numArguments() const;
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedBasicBlock BranchInst_getTargetBlock() const;
BRIDGED_INLINE SwiftInt SwitchEnumInst_getNumCases() const;

View File

@@ -1333,6 +1333,10 @@ SwiftInt BridgedInstruction::BeginApplyInst_numArguments() const {
return getAs<swift::BeginApplyInst>()->getNumArguments();
}
bool BridgedInstruction::BeginApplyInst_isCalleeAllocated() const {
return getAs<swift::BeginApplyInst>()->isCalleeAllocated();
}
SwiftInt BridgedInstruction::TryApplyInst_numArguments() const {
return getAs<swift::TryApplyInst>()->getNumArguments();
}