summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-12-28 23:45:54 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-12-28 23:45:54 +0000
commit5022bb723853051a17d983322d30dfdac76d0914 (patch)
tree472a39c0b95ed89077d899f8d1f15ddf5eb751e1 /llvm/tools
parent6c37d298d9e7291946c4c75d981902b496e9bd8b (diff)
downloadbcm5719-llvm-5022bb723853051a17d983322d30dfdac76d0914.tar.gz
bcm5719-llvm-5022bb723853051a17d983322d30dfdac76d0914.zip
Change Metadata Index emission in the bitcode to use 2x32 bits for the placeholder
The Bitstream reader and writer are limited to handle a "size_t" at most, which means that we can't backpatch and read back a 64bits value on 32 bits platform. llvm-svn: 290693
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
index 3220063275b..f97a18448f0 100644
--- a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -609,7 +609,12 @@ static bool ParseBlock(BitstreamCursor &Stream, BitstreamBlockInfo &BlockInfo,
// and validate its forward reference offset was correct!
if (BlockID == bitc::METADATA_BLOCK_ID) {
if (Code == bitc::METADATA_INDEX_OFFSET) {
- MetadataIndexOffset = Stream.GetCurrentBitNo() + Record[0];
+ if (Record.size() != 2)
+ outs() << "(Invalid record)";
+ else {
+ auto Offset = Record[0] + (Record[1] << 32);
+ MetadataIndexOffset = Stream.GetCurrentBitNo() + Offset;
+ }
}
if (Code == bitc::METADATA_INDEX) {
outs() << " (offset ";
OpenPOWER on IntegriCloud