mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Swiftify] Don't drop bounds checks when mixing std::span and counted_by
When an imported function combines std::span and __counted_by, std::span would override bounds checks emitted for __counted_by (if it occurred later in the the parameter list) resulting in no bounds checks being emitted. rdar://147883384
This commit is contained in:
@@ -411,7 +411,7 @@ struct CxxSpanThunkBuilder: ParamPointerBoundsThunkBuilder {
|
||||
let isSizedBy: Bool = false
|
||||
|
||||
func buildBoundsChecks() throws -> [CodeBlockItemSyntax.Item] {
|
||||
return []
|
||||
return try base.buildBoundsChecks()
|
||||
}
|
||||
|
||||
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
|
||||
@@ -447,7 +447,7 @@ struct CxxSpanReturnThunkBuilder: BoundsCheckedThunkBuilder {
|
||||
public let node: SyntaxProtocol
|
||||
|
||||
func buildBoundsChecks() throws -> [CodeBlockItemSyntax.Item] {
|
||||
return []
|
||||
return try base.buildBoundsChecks()
|
||||
}
|
||||
|
||||
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
|
||||
|
||||
Reference in New Issue
Block a user