tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Segmentation fault compiling jslong.c


From: Rob Landley
Subject: Re: [Tinycc-devel] Segmentation fault compiling jslong.c
Date: Thu, 20 Sep 2007 15:48:03 -0500
User-agent: KMail/1.9.6

On Thursday 20 September 2007 5:19:20 am Daniel Glöckner wrote:
> On Thu, Sep 20, 2007 at 04:01:48AM -0500, Rob Landley wrote:
> > 2) Attempts to generate code before the first function declaration
> > segfault the compiler, which is very wrong.
>
> I remember that problem. I even added cur_text_section=NULL; at the
> beginning of tcc_compile and at the end of gen_function to force a
> segfault. TCC shouldn't pretend to be working when it is generating code
> to initialize global variables between functions.

In the only test case I have, right after it generates the code it realizes it 
shouldn't have and errors out with the complaint about the initializer not 
being constant.  So it never attempts to _use_ the code it generates, it just 
checks for the error a bit late.  Do you have a test case it would try to 
keep the resulting code?

I'm wondering if there's some circumstance under which it _should_ generate 
code that runs before "main", and if so how I'd go about it.  (The "no, it 
should enver do this" is the easy case to fix, but I'm unsure whether or not 
that's the case...)

Rob
-- 
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.




reply via email to

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