Cast earlier. We know we can get a DefinedSVal.

llvm-svn: 106084
This commit is contained in:
Zhongxing Xu 2010-06-16 05:52:03 +00:00
parent 8225bda0d5
commit 9fe7e9129b
1 changed files with 3 additions and 3 deletions

View File

@ -80,15 +80,15 @@ void StreamChecker::FOpen(CheckerContext &C, const CallExpr *CE) {
const GRState *state = C.getState();
unsigned Count = C.getNodeBuilder().getCurrentBlockCount();
ValueManager &ValMgr = C.getValueManager();
SVal RetVal = ValMgr.getConjuredSymbolVal(0, CE, Count);
DefinedSVal RetVal = cast<DefinedSVal>(ValMgr.getConjuredSymbolVal(0, CE,
Count));
state = state->BindExpr(CE, RetVal);
ConstraintManager &CM = C.getConstraintManager();
// Bifurcate the state into two: one with a valid FILE* pointer, the other
// with a NULL.
const GRState *stateNotNull, *stateNull;
llvm::tie(stateNotNull, stateNull)
= CM.AssumeDual(state, cast<DefinedSVal>(RetVal));
llvm::tie(stateNotNull, stateNull) = CM.AssumeDual(state, RetVal);
C.addTransition(stateNotNull);
C.addTransition(stateNull);