Skip to content

Commit 30c929f

Browse files
committed
[cxx-interop][nfc] Fix rebase fallout; fix typo.
1 parent 65dc0d3 commit 30c929f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

SwiftCompilerSources/Sources/Basic/Utils.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public struct StringRef : CustomStringConvertible, NoReflectionChildren {
7878
let buffer = UnsafeBufferPointer<UInt8>(start: _bridged.bytes_begin(),
7979
count: count)
8080
#else
81-
let buffer = UnsafeBufferPointer<UInt8>(start: _bridged.bytes_begin(),
81+
let buffer = UnsafeBufferPointer<UInt8>(start: _bridged.__bytes_beginUnsafe(),
8282
count: count)
8383
#endif
8484
return buffer[index]
@@ -90,7 +90,9 @@ public struct StringRef : CustomStringConvertible, NoReflectionChildren {
9090
start: lhs._bridged.bytes_begin(),
9191
count: lhs.count)
9292
#else
93-
count: Int(lhs._bridged.__bytes_endUnsafe() - lhs._bridged.__bytes_beginUnsafe()))
93+
let lhsBuffer = UnsafeBufferPointer<UInt8>(
94+
start: lhs._bridged.__bytes_beginUnsafe(),
95+
count: lhs.count)
9496
#endif
9597
return rhs.withUTF8Buffer { (rhsBuffer: UnsafeBufferPointer<UInt8>) in
9698
if lhsBuffer.count != rhsBuffer.count { return false }

lib/ClangImporter/ClangImporter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6834,7 +6834,7 @@ bool IsSafeUseOfCxxDecl::evaluate(Evaluator &evaluator,
68346834
}
68356835

68366836
// A projection of a view type (such as a string_view) from a self
6837-
// contained parent is a proejction (unsafe).
6837+
// contained parent is a projection (unsafe).
68386838
if (!anySubobjectsSelfContained(cxxRecordReturnType) &&
68396839
!hasOwnedValueAttr(cxxRecordReturnType) &&
68406840
hasPointerInSubobjects(cxxRecordReturnType)) {

0 commit comments

Comments
 (0)