Skip to content

Commit 7520452

Browse files
committed
[Backtracing] Fix memory capture output.
A couple of commas were in the wrong place.
1 parent b5461ae commit 7520452

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

stdlib/public/libexec/swift-backtrace/JSON.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import CRT
2626
@_spi(Internal) import Runtime
2727
@_spi(MemoryReaders) import Runtime
2828

29-
// ###TODO: Escape JSON strings
30-
3129
extension SwiftBacktrace {
3230

3331
static func outputJSONCrashLog() {
@@ -277,7 +275,7 @@ extension SwiftBacktrace {
277275
}
278276

279277
if !capturedBytes.isEmpty && !(args.sanitize ?? false) {
280-
write(#"", capturedMemory": {"#)
278+
write(#", "capturedMemory": {"#)
281279
var first = true
282280
for (address, bytes) in capturedBytes {
283281
let formattedBytes = bytes
@@ -290,7 +288,7 @@ extension SwiftBacktrace {
290288
}
291289
write(" \"\(hex(address))\": \"\(formattedBytes)\"")
292290
}
293-
write(" }, ")
291+
write(" }")
294292
}
295293

296294
func outputJSONImage(_ image: Backtrace.Image, first: Bool) {

0 commit comments

Comments
 (0)