summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorVictor Leschuk <vleschuk@accesssoftek.com>2016-10-18 14:31:22 +0000
committerVictor Leschuk <vleschuk@accesssoftek.com>2016-10-18 14:31:22 +0000
commit197aa3192dd8d25330c23274a0d257c6130e4e09 (patch)
tree3e44f15c8447ba9ddc035c2a0778d47a17ea1ee5 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentaff4d141b922cc6cbbcd575a289fee76271259e7 (diff)
downloadbcm5719-llvm-197aa3192dd8d25330c23274a0d257c6130e4e09.tar.gz
bcm5719-llvm-197aa3192dd8d25330c23274a0d257c6130e4e09.zip
DebugInfo: change alignment type from uint64_t to uint32_t to save space.
In futher patches we shall have alignment field added to DIVariable family and switching from uint64_t to uint32_t will save 4 bytes per variable. Differential Revision: https://reviews.llvm.org/D25620 llvm-svn: 284482
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index df9ab1c496c..09118ea4c3a 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2497,7 +2497,9 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
Metadata *Scope = getDITypeRefOrNull(Record[5]);
Metadata *BaseType = getDITypeRefOrNull(Record[6]);
uint64_t SizeInBits = Record[7];
- uint64_t AlignInBits = Record[8];
+ if (Record[8] > (uint64_t)std::numeric_limits<uint32_t>::max())
+ return error("Alignment value is too large");
+ uint32_t AlignInBits = Record[8];
uint64_t OffsetInBits = Record[9];
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[10]);
Metadata *Elements = getMDOrNull(Record[11]);
OpenPOWER on IntegriCloud