[cfe-dev] Analysis/ptr-arith.c fails on 64-bit systems

Ted Kremenek kremenek at apple.com
Fri Mar 13 07:45:10 PDT 2009


Thanks Sebastian.  I'll look at this today.

On Mar 13, 2009, at 7:15 AM, Sebastian Redl wrote:

> Hi,
>
> The test case Analysis/ptr-arith.c currently fails on 64-bit systems.
> The reason is the evaluation of this expression:
> colon + 1
>
> The evaluator (RegionStoreManager::EvalBinOp) assumes that L and R  
> (Base
> and Offset) have the same width. However, in the above expression on
> 64-bit systems, Base is the pointer with 64 bits, whereas the Offset  
> is
> the literal 1, which has type int and thus is only 32 bits wide.
> ConvertSignedness thus asserts.
>
> I'm not sure what the best fix is here. Probably to call
> getBasicVals()->getValue(Offset->getValue().getSExtValue(),
> Base->getValue().getBitWidth(), Base->getValue().isUnsigned) instead  
> of
> ConvertSignedness.
>
> Sebastian
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list