diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-12-11 23:34:30 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-12-11 23:34:30 +0000 |
commit | eca1e031d152fa10861919bafacb769513ce3d2c (patch) | |
tree | d8c9137f2dfa54c306db4113dd9dc51ea9e96ac3 /llvm/test/Bitcode | |
parent | c694ac5519880fe9ec487c9289d2bb2503c6a8d4 (diff) | |
download | bcm5719-llvm-eca1e031d152fa10861919bafacb769513ce3d2c.tar.gz bcm5719-llvm-eca1e031d152fa10861919bafacb769513ce3d2c.zip |
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
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/mdstring-high-bits.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/mdstring-high-bits.ll b/llvm/test/Bitcode/mdstring-high-bits.ll new file mode 100644 index 00000000000..ffc4f6ed184 --- /dev/null +++ b/llvm/test/Bitcode/mdstring-high-bits.ll @@ -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"} |