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.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index 7d8859b9f8..a8386645db 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -326,7 +326,8 @@ void BytecodeParser::ParseConstantPool(const unsigned char *&Buf,
// If we are reading a function constant table, make sure that we adjust
// the slot number to be the real global constant number.
//
- if (&Tab != &ModuleValues && Typ < ModuleValues.size())
+ if (&Tab != &ModuleValues && Typ < ModuleValues.size() &&
+ ModuleValues[Typ])
Slot += ModuleValues[Typ]->size();
ResolveReferencesToConstant(C, Slot);
}