llvm.org GIT mirror llvm / aae1f9f
llvm-undname: Fix assert-on->4GiB-string-literal, found by oss-fuzz git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359109 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 1 year, 7 months ago
2 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
11531153 return Result;
11541154 }
11551155
1156 // A mangled (non-wide) string literal stores the total length of the string it
1157 // refers to (passed in NumBytes), and it contains up to 32 bytes of actual text
1158 // (passed in StringBytes, NumChars).
11561159 static unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars,
1157 unsigned NumBytes) {
1160 uint64_t NumBytes) {
11581161 assert(NumBytes > 0);
11591162
11601163 // If the number of bytes is odd, this is guaranteed to be a char string.
791791
792792 ??_C@_07LJGFEJEB@D3?$CC?$BB?$AA?$AA?$AA?$AA@)
793793 ; CHECK: U"\x11223344"
794
795 ; This has a string length of 0x6_0000_0000, so it's 0 if treated as a 32-bit
796 ; number. (In practice, 24GiB large string literals should be rare.)
797 ??_C@_0GAAAAAAAA@GPLEPFHO@01234567890123456789012345678901@
798 ; CHECK: "01234567890123456789012345678901"...