Cast earlier. We know we can get a DefinedSVal.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 16 Jun 2010 05:52:03 +0000 (05:52 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 16 Jun 2010 05:52:03 +0000 (05:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106084 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/StreamChecker.cpp

index 80c29a131e0d50a4cd4cc6cf9165c0c7e4e8af97..306188370608de0deb02cf9d415c45cb071b0320 100644 (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);