From 197aa3192dd8d25330c23274a0d257c6130e4e09 Mon Sep 17 00:00:00 2001 From: Victor Leschuk Date: Tue, 18 Oct 2016 14:31:22 +0000 Subject: 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 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index df9ab1c..09118ea 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::max()) + return error("Alignment value is too large"); + uint32_t AlignInBits = Record[8]; uint64_t OffsetInBits = Record[9]; DINode::DIFlags Flags = static_cast(Record[10]); Metadata *Elements = getMDOrNull(Record[11]); -- cgit v1.1