[cfe-commits] r89591 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sun Nov 22 17:44:17 PST 2009


Yes. That's why we should check the result *after* it's evaluated.

2009/11/23 Ted Kremenek <kremenek at apple.com>:
> Correction: I don't think the comments are true anymore (so they should be removed) as we don't check if LeftV or RightV are undefined, but I also stand by my comment that we can get an UndefinedVal even when LeftV and RightV are defined.  For example, take a look at nonloc::ConcreteInt::evalBinOp().
>
> On Nov 22, 2009, at 12:06 PM, Ted Kremenek wrote:
>
>> On Nov 22, 2009, at 5:30 AM, Zhongxing Xu wrote:
>>
>>> Author: zhongxingxu
>>> Date: Sun Nov 22 07:30:10 2009
>>> New Revision: 89591
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=89591&view=rev
>>> Log:
>>> Remove invalid comments. The result is undefined only when operands are undefined.
>>
>> Zhongxing,
>>
>> I don't think that's true.  The result of an operation can still be undefined even when the operands are well defined, e.g. bitshifting by too much.  Aren't these comments still valid?
>>
>>
>>>
>>> Modified:
>>>   cfe/trunk/lib/Analysis/GRExprEngine.cpp
>>>
>>> Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=89591&r1=89590&r2=89591&view=diff
>>>
>>> ==============================================================================
>>> --- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
>>> +++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Sun Nov 22 07:30:10 2009
>>> @@ -2711,8 +2711,6 @@
>>>        state = state->BindExpr(B, Result);
>>>
>>>        if (Result.isUndef()) {
>>> -          // The operands were *not* undefined, but the result is undefined.
>>> -          // This is a special node that should be flagged as an error.
>>>          if (ExplodedNode *UndefNode = Builder->generateNode(B, state, *I2)){
>>>            UndefNode->markAsSink();
>>>            UndefResults.insert(UndefNode);
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>
>> _______________________________________________
>> 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