Dwarf: use utostr on CUID to append to SmallString.
authorManman Ren <mren@apple.com>
Sat, 6 Apr 2013 01:02:38 +0000 (01:02 +0000)
committerManman Ren <mren@apple.com>
Sat, 6 Apr 2013 01:02:38 +0000 (01:02 +0000)
We used to do "SmallString += CUID", which is incorrect, since CUID will
be truncated to a char.

rdar://problem/13573833

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178941 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index d3cb4f9c1c0ef179c4b7896c0082a6ef22a11534..8bd9feb92abbcd70fcb84e8fb394338972764548 100644 (file)
@@ -643,7 +643,7 @@ unsigned DwarfDebug::getOrCreateSourceID(StringRef FileName,
 
   // We look up the CUID/file/dir by concatenating them with a zero byte.
   SmallString<128> NamePair;
-  NamePair += CUID;
+  NamePair += utostr(CUID);
   NamePair += '\0';
   NamePair += DirName;
   NamePair += '\0'; // Zero bytes are not allowed in paths.