summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-12-11 23:34:30 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-12-11 23:34:30 +0000
commiteca1e031d152fa10861919bafacb769513ce3d2c (patch)
treed8c9137f2dfa54c306db4113dd9dc51ea9e96ac3 /llvm/lib/Bitcode/Writer
parentc694ac5519880fe9ec487c9289d2bb2503c6a8d4 (diff)
downloadbcm5719-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/lib/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 90ac1f19b7d..c349d1053de 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -800,7 +800,7 @@ static void WriteModuleMetadata(const Module *M,
}
// Code: [strchar x N]
- Record.append(MDS->begin(), MDS->end());
+ Record.append(MDS->bytes_begin(), MDS->bytes_end());
// Emit the finished record.
Stream.EmitRecord(bitc::METADATA_STRING, Record, MDSAbbrev);
OpenPOWER on IntegriCloud