[cfe-dev] core dump, how to best investigate

Chris Lattner clattner at apple.com
Tue Jul 24 09:21:35 PDT 2007


On Jul 24, 2007, at 6:43 AM, Jeroen Ruigrok van der Werven wrote:

> -On [20070724 15:40], Jeroen Ruigrok van der Werven (asmodai at in- 
> nomine.org) wrote:
>> So ParseUnaryOp() has an input which is empty and as such  
>> resultType =
>> Input->getType(); fails.
>
> Would it make sense to add a fail-safe in the form of (excuse my C+ 
> + I'm
> better in C and C#):
>
> if (Input == NULL) {
>   bail_out();
> }
> resultType = Input->getType();

Yep, generally the idiom would be:

   assert(Input && "Expected an input AST node");

-Chris



More information about the cfe-dev mailing list