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.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp
index 67cfff7b97..aaecedddfa 100644
--- a/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/lib/Bytecode/Reader/ConstantReader.cpp
@@ -241,8 +241,8 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf,
unsigned Slot;
if (read_vbr(Buf, EndBuf, Slot)) return failure(true);
Value *V = getValue(AT->getElementType(), Slot, false);
- if (!V || !V->isConstant()) return failure(true);
- Elements.push_back((ConstPoolVal*)V);
+ if (!V || !isa<ConstPoolVal>(V)) return failure(true);
+ Elements.push_back(cast<ConstPoolVal>(V));
}
V = ConstPoolArray::get(AT, Elements);
break;
@@ -257,9 +257,9 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf,
unsigned Slot;
if (read_vbr(Buf, EndBuf, Slot)) return failure(true);
Value *V = getValue(ET[i], Slot, false);
- if (!V || !V->isConstant())
+ if (!V || !isa<ConstPoolVal>(V))
return failure(true);
- Elements.push_back((ConstPoolVal*)V);
+ Elements.push_back(cast<ConstPoolVal>(V));
}
V = ConstPoolStruct::get(ST, Elements);