[cfe-commits] r80869 - /cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Wed Sep 2 18:51:42 PDT 2009
Thanks Ted.
On Thu, Sep 3, 2009 at 9:48 AM, Ted Kremenek<kremenek at apple.com> 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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list