llvm-project
5ff4a476 - [lld-macho] Fix export trie for names containing 0xff bytes

Commit
9 days ago
[lld-macho] Fix export trie for names containing 0xff bytes On signed-char hosts, charAt() returns -1 for a 0xff byte, aliasing the end-of-string sentinel in the three-way radix sort. This can silently drop or truncate an export, or trigger an assertion in assertions-enabled builds. Convert to unsigned char before promoting to int so every byte compares above the sentinel, matching ld64's handling of these names. This also changes edge order for names containing bytes 0x80-0xfe on signed-char hosts. The trie still encodes the same exports, and its output is now consistent across hosts regardless of char signedness.
Author
Committer
Parents
Loading