mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
fix an uninitialized pointer in BridgedSourceLoc
It's so easy to run into undefined behavior in C++
This commit is contained in:
@@ -27,11 +27,11 @@ public struct SourceLoc {
|
||||
guard bridged.isValid() else {
|
||||
return nil
|
||||
}
|
||||
self.locationInFile = bridged.opaquePointer!
|
||||
self.locationInFile = bridged.uint8Pointer()!
|
||||
}
|
||||
|
||||
public var bridged: BridgedSourceLoc {
|
||||
.init(opaquePointer: locationInFile)
|
||||
.init(locationInFile)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user