Skip to content

Commit 72230da

Browse files
authored
Merge pull request #79394 from al45tair/eng/PR-144497804
[Backtracing] Fix bug in Compact Image Map decoder.
2 parents 572298b + 864f3dc commit 72230da

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/CompactImageMapFormat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ need to be stored in CIF data:
106106
| 8 | `/System/Applications` |
107107
| 9 | `/Applications` |
108108
| 10 | `C:\Windows\System32` |
109-
| 11 | `C:\Program Files\` |
109+
| 11 | `C:\Program Files` |
110110

111111
Codes below 32 are reserved for future expansion of the fixed list.
112112

stdlib/public/RuntimeModule/CompactImageMap.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,15 @@ public enum CompactImageMapFormat {
244244
if (byte & 0x40) == 0 {
245245
code = Int(byte & 0x3f)
246246
} else {
247-
let byteCount = Int(byte & 0x3f)
247+
let byteCount = Int(byte & 0x3f) + 1
248248
code = 0
249249
for _ in 0..<byteCount {
250250
guard let byte = iterator.next() else {
251251
return nil
252252
}
253253
code = (code << 8) | Int(byte)
254254
}
255+
code += 64
255256
}
256257

257258
#if DEBUG_COMPACT_IMAGE_MAP

0 commit comments

Comments
 (0)