aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/ConstantReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode/Reader/ConstantReader.cpp')
-rw-r--r--lib/Bytecode/Reader/ConstantReader.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index d1c8644ddd..0ad38b4025 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -245,19 +245,13 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf,
break;
}
- case Type::SByteTyID: // Unsigned integer types...
+ case Type::SByteTyID: // Signed integer types...
case Type::ShortTyID:
case Type::IntTyID: {
- int Val;
- if (read_vbr(Buf, EndBuf, Val)) return true;
- if (!ConstantSInt::isValueValidForType(Ty, Val)) return true;
- V = ConstantSInt::get(Ty, Val);
- break;
- }
-
- case Type::LongTyID: {
+ case Type::LongTyID:
int64_t Val;
if (read_vbr(Buf, EndBuf, Val)) return true;
+ if (!ConstantSInt::isValueValidForType(Ty, Val)) return true;
V = ConstantSInt::get(Ty, Val);
break;
}