Skip to content

[Backtracing] Fix bug in Compact Image Map decoder. #79394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/CompactImageMapFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion stdlib/public/RuntimeModule/CompactImageMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,15 @@ 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 {
return nil
}
code = (code << 8) | Int(byte)
}
code += 64
}

#if DEBUG_COMPACT_IMAGE_MAP
Expand Down