1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

llvm-undname: Fix assert-on->4GiB-string-literal, found by oss-fuzz

llvm-svn: 359109
This commit is contained in:
Nico Weber 2019-04-24 16:09:38 +00:00
parent 4c563335f4
commit d61232fbea
2 changed files with 9 additions and 1 deletions

View File

@ -1154,8 +1154,11 @@ static unsigned countEmbeddedNulls(const uint8_t *StringBytes,
return Result;
}
// A mangled (non-wide) string literal stores the total length of the string it
// refers to (passed in NumBytes), and it contains up to 32 bytes of actual text
// (passed in StringBytes, NumChars).
static unsigned guessCharByteSize(const uint8_t *StringBytes, unsigned NumChars,
unsigned NumBytes) {
uint64_t NumBytes) {
assert(NumBytes > 0);
// If the number of bytes is odd, this is guaranteed to be a char string.

View File

@ -792,3 +792,8 @@
??_C@_07LJGFEJEB@D3?$CC?$BB?$AA?$AA?$AA?$AA@)
; CHECK: U"\x11223344"
; This has a string length of 0x6_0000_0000, so it's 0 if treated as a 32-bit
; number. (In practice, 24GiB large string literals should be rare.)
??_C@_0GAAAAAAAA@GPLEPFHO@01234567890123456789012345678901@
; CHECK: "01234567890123456789012345678901"...