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

Sebastian Redl sebastian.redl at getdesigned.at
Fri Mar 13 09:15:11 CDT 2009


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


More information about the cfe-dev mailing list