forked from OSchip/llvm-project
RemoveDeadBindings should now check for UninitalizedVal, as it is a now
an error to cast it to LVal. llvm-svn: 47450
This commit is contained in:
parent
7328fa6ec8
commit
e82c7a44d6
|
@ -94,8 +94,15 @@ ValueStateManager::RemoveDeadBindings(ValueState St, Stmt* Loc,
|
||||||
Marked.insert(V);
|
Marked.insert(V);
|
||||||
|
|
||||||
if (V->getType()->isPointerType()) {
|
if (V->getType()->isPointerType()) {
|
||||||
const LVal& LV =
|
|
||||||
cast<LVal>(GetRVal(St, lval::DeclVal(cast<VarDecl>(V))));
|
RVal X = GetRVal(St, lval::DeclVal(cast<VarDecl>(V)));
|
||||||
|
|
||||||
|
assert (!X.isUnknown());
|
||||||
|
|
||||||
|
if (X.isUninit())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
LVal LV = cast<LVal>(X);
|
||||||
|
|
||||||
for (RVal::symbol_iterator SI = LV.symbol_begin(), SE = LV.symbol_end();
|
for (RVal::symbol_iterator SI = LV.symbol_begin(), SE = LV.symbol_end();
|
||||||
SI != SE; ++SI) {
|
SI != SE; ++SI) {
|
||||||
|
|
|
@ -367,6 +367,10 @@ public:
|
||||||
return R.isValid() ? TF->EvalBinOp(ValMgr, Op, L, cast<NonLVal>(R)) : R;
|
return R.isValid() ? TF->EvalBinOp(ValMgr, Op, L, cast<NonLVal>(R)) : R;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RVal EvalBinOp(BinaryOperator::Opcode Op, NonLVal L, NonLVal R) {
|
||||||
|
return R.isValid() ? TF->EvalBinOp(ValMgr, Op, L, R) : R;
|
||||||
|
}
|
||||||
|
|
||||||
RVal EvalBinOp(BinaryOperator::Opcode Op, RVal L, RVal R) {
|
RVal EvalBinOp(BinaryOperator::Opcode Op, RVal L, RVal R) {
|
||||||
|
|
||||||
if (L.isUninit() || R.isUninit())
|
if (L.isUninit() || R.isUninit())
|
||||||
|
|
Loading…
Reference in New Issue