Bitcode: Use unsigned char to record MDStrings

`MDString`s can have arbitrary characters in them.  Prevent an assertion
that fired in `BitcodeWriter` because of sign extension by copying the
characters into the record as `unsigned char`s.

Based on a patch by Keno Fischer; fixes PR21882.

llvm-svn: 224077
This commit is contained in:
Duncan P. N. Exon Smith
2014-12-11 23:34:30 +00:00
parent c694ac5519
commit eca1e031d1
4 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; PR21882: confirm we don't crash when high bits are set in a character in a
; metadata string.
; CHECK: !name = !{!0}
!name = !{!0}
; CHECK: !0 = metadata !{metadata !"\80"}
!0 = metadata !{metadata !"\80"}