From 8eeaf5178dfda82b51766ea106febd7f563bc08f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 20 Apr 2019 23:59:06 +0000 Subject: llvm-undname: Improve string literal demangling with embedded \0 chars - Don't assert when a string looks like a u32 string to the heuristic but doesn't have a length that's 0 mod 4. Instead, classify those as u16 with embedded \0 chars. Found by oss-fuzz. - Print embedded nul bytes as \0 instead of \x00. llvm-svn: 358835 --- llvm/test/Demangle/ms-string-literals.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'llvm/test/Demangle/ms-string-literals.test') diff --git a/llvm/test/Demangle/ms-string-literals.test b/llvm/test/Demangle/ms-string-literals.test index 1e634099124..2fe3384fe74 100644 --- a/llvm/test/Demangle/ms-string-literals.test +++ b/llvm/test/Demangle/ms-string-literals.test @@ -771,3 +771,13 @@ ??_C@_0CG@HJGBPLNO@l?$AAo?$AAo?$AAk?$AAA?$AAh?$AAe?$AAa?$AAd?$AAH?$AAa?$AAr?$AAd?$AAB?$AAr?$AAe?$AA@ ; CHECK: u"lookAheadHardBre"... + + +; These are u16 strings that the diagnostic would classify as u32 -- except +; that their byte length % 4 is 2, so they can't be u32. + +??_C@_05LABPAAN@b?$AA?$AA?$AA?$AA?$AA@ +; CHECK: u"b\0" + +??_C@_0CC@MBPKDIAM@a?$AA?$AA?$AAb?$AA?$AA?$AAc?$AA?$AA?$AAd?$AA?$AA?$AAe?$AA?$AA?$AAf?$AA?$AA?$AAg?$AA?$AA?$AAh?$AA?$AA?$AA@ +; CHECK: u"a\0b\0c\0d\0e\0f\0g\0h\0"... -- cgit v1.2.3