tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] const_wanted


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] const_wanted
Date: Sun, 31 Jul 2011 16:05:42 +0200
User-agent: KMail/1.13.7 (Linux/3.0.0-1-amd64; KDE/4.6.5; x86_64; ; )

Le dimanche 31 juillet 2011 15:58:25, grischka a écrit :
> Thomas Preud'homme wrote in
> http://repo.or.cz/w/tinycc.git/commitdiff/b2f5ee9b2d
> 
> > Force const. expr. in expr_cond outside function
> > 
> > Since no code should be generated outside a function, force expr_cond to
> > only consider constant expression when outside a function since the
> > generic code can generate some code.
> 
> Can you show an example where this happens, that is that
>     const_wanted is false
> and
>     cur_text_section is NULL
> at the same time in cond_expr()?
> 
> --- grischka
Sure. It's a side effect of the VLA array patches. On Hurd, there is a header 
with something like:

#define FOO_COUNT (cond ? 2 : 42)

type foo_array[FOO_SIZE];

This lead post_type to call gexpr() which will eventually call cond_expr() 
without const_wanted. This in turn will try to generate some code but will 
segfault due to cur_text_section being NULL (this is how I spotted it, it 
caused a segfault in the testsuite on Hurd)

I can give you the exact content of the header on Hurd if you need.

Best regards,

Thomas Preud'homme

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]