Thanks Ted. On Thu, Sep 3, 2009 at 9:48 AM, Ted Kremenek<[email protected]> wrote: > Author: kremenek > Date: Wed Sep 2 20:48:03 2009 > New Revision: 80869 > > URL: http://llvm.org/viewvc/llvm-project?rev=80869&view=rev > Log: > Fix regression introduced in r80786 and reported in PR 4867. We should use > 'dyn_cast' instead of 'cast' as the denominator value could be UnknownVal (and > is not guaranteed to be a DefinedVal). > > Modified: > cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp > > Modified: cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp?rev=80869&r1=80868&r2=80869&view=diff > > ============================================================================== > --- cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp (original) > +++ cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp Wed Sep 2 20:48:03 > 2009 > @@ -716,11 +716,16 @@ > return; > } > > + // Handle the case where 'Denom' is UnknownVal. > + const DefinedSVal *DV = dyn_cast<DefinedSVal>(&Denom); > + > + if (!DV) > + return; > + > // Check for divide by zero. > ConstraintManager &CM = C.getConstraintManager(); > const GRState *stateNotZero, *stateZero; > - llvm::tie(stateNotZero, stateZero) = CM.AssumeDual(C.getState(), > - > cast<DefinedSVal>(Denom)); > + llvm::tie(stateNotZero, stateZero) = CM.AssumeDual(C.getState(), *DV); > > if (stateZero && !stateNotZero) { > if (ExplodedNode *N = C.GenerateNode(B, stateZero, true)) { > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
