[Backtracing] Fix bug in Compact Image Map decoder.

The `expand` opcode was being decoded incorrectly in the case where we
were trying to expand prefixes with codes of 64 or above.

rdar://144497804
This commit is contained in:
Alastair Houghton
2025-02-14 14:59:20 +00:00
parent 5c1a02adfd
commit 864f3dc023
2 changed files with 3 additions and 2 deletions

View File

@@ -106,7 +106,7 @@ need to be stored in CIF data:
| 8 | `/System/Applications` |
| 9 | `/Applications` |
| 10 | `C:\Windows\System32` |
| 11 | `C:\Program Files\` |
| 11 | `C:\Program Files` |
Codes below 32 are reserved for future expansion of the fixed list.

View File

@@ -244,7 +244,7 @@ public enum CompactImageMapFormat {
if (byte & 0x40) == 0 {
code = Int(byte & 0x3f)
} else {
let byteCount = Int(byte & 0x3f)
let byteCount = Int(byte & 0x3f) + 1
code = 0
for _ in 0..<byteCount {
guard let byte = iterator.next() else {
@@ -252,6 +252,7 @@ public enum CompactImageMapFormat {
}
code = (code << 8) | Int(byte)
}
code += 64
}
#if DEBUG_COMPACT_IMAGE_MAP