mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[cxx-interop][SwiftCompilerSources] Fix conversion between std::string and Swift.String
This fixes a dangling pointer issue when creating a `Swift.String` from `std::string`.
Also fixes a warning:
```
warning: variable 's' was never mutated; consider changing to 'let' constant
var s = SILBasicBlock_debugDescription(bridged)
~~~ ^
let
```
rdar://92963081
rdar://93053488
This commit is contained in:
@@ -81,8 +81,7 @@ public enum Ownership {
|
||||
|
||||
extension Value {
|
||||
public var description: String {
|
||||
var s = SILNode_debugDescription(bridgedNode)
|
||||
return String(cString: s.c_str())
|
||||
String(_cxxString: SILNode_debugDescription(bridgedNode))
|
||||
}
|
||||
|
||||
public var uses: UseList {
|
||||
|
||||
Reference in New Issue
Block a user