[cfe-dev] signess error when building cfg

Chris Lattner clattner at apple.com
Thu Jul 3 20:07:24 PDT 2008

On Jul 3, 2008, at 6:43 PM, Eli Friedman wrote:
>> Stack trace:
>> #4  0x91ca9063 in __assert_rtn ()
>> #5  0x00028789 in llvm::APSInt::operator+= (this=0xbfffe5b0,
>> RHS=@0xbfffe454) at APSInt.h:159
>> #6  0x00025fd9 in clang::Expr::isIntegerConstantExpr (this=0xc0ae30,
>> Result=@0xbfffe5b0, Ctx=@0xbfffef80, Loc=0x0, isEvaluated=true) at
>> /Users/Projects/Tools/llvm/tools/clang/lib/AST/Expr.cpp:876
> Mmm, if I'm not mistaken, this looks like a known issue with the hack
> allowing pointers in integer constant expressions; I was planning to
> fix it sooner, but the right fix grew a bit bigger than I expected it
> to, and I never got around to coming up with a quick hack.
> (Specifically, the complete fix involves the new constant expression
> evaluator work.)

Yes, it is.  We really need to fix this.  I poked at this briefly, and  
the basic problem is that isIntegerConstantExpr returns true for casts  
from pointer but doesn't fill in Result.  We really should only return  
true (in the GCC hack mode) if we are able to fold the pointer  


More information about the cfe-dev mailing list