summaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-04 05:28:27 +0000
committerChris Lattner <sabre@nondot.org>2004-12-04 05:28:27 +0000
commit02dce169c80b1c1569b7a6fe658dcbc8a4fef760 (patch)
tree049c8dbe5ba87066bb155a3f6b1d529312f95c18 /lib/Bytecode
parent368cb8e67e8cd7e8ab1d91215695731b99db63e5 (diff)
downloadllvm-02dce169c80b1c1569b7a6fe658dcbc8a4fef760.tar.gz
llvm-02dce169c80b1c1569b7a6fe658dcbc8a4fef760.tar.bz2
llvm-02dce169c80b1c1569b7a6fe658dcbc8a4fef760.tar.xz
Do not allow bytecode files with unresolved references to be read. Doing
so lets wierd ConstantPlaceholder objects sneak into the system which confuses it greatly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index a5e70d911f..a18019aca0 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1312,7 +1312,7 @@ Constant *BytecodeReader::ParseConstantValue(unsigned TypeID) {
// Construct a ConstantExpr of the appropriate kind
if (isExprNumArgs == 1) { // All one-operand expressions
if (Opcode != Instruction::Cast)
- error("Only Cast instruction has one argument for ConstantExpr");
+ error("Only cast instruction has one argument for ConstantExpr");
Constant* Result = ConstantExpr::getCast(ArgVec[0], getType(TypeID));
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
@@ -1568,6 +1568,12 @@ void BytecodeReader::ParseConstantPool(ValueTable &Tab,
}
}
}
+
+ // After we have finished parsing the constant pool, we had better not have
+ // any dangling references left.
+ if (!ConstantFwdRefs.empty())
+ error("Unresolved constant references exist!");
+
checkPastBlockEnd("Constant Pool");
if (Handler) Handler->handleGlobalConstantsEnd();
}