tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] pointers to static functions inside a static table


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] pointers to static functions inside a static table
Date: Tue, 31 Aug 2010 04:08:11 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-5-686; KDE/4.4.5; i686; ; )

Le mardi 31 août 2010 01:46:48, vous avez écrit :
> Hi,
> 
> I think I could fix the null pointer issue by
> 
> http://repo.or.cz/w/tinycc.git/commit/c31dc7aa0c36e19e15cf41a0d2728e89ad339
> 660
Wow, that was fast. Congrats!
> 
> We still need a fix for braces though.
I may have found what the problem is but as it's very late I may be completely 
wrong as well.

decl_initializer_alloc uses 3 times macro_ptr = init_str.str; to restore the 
state of the parser. I never managed to follow the code to see how macro_ptr 
and buf_ptr are connected but it seems to me that next() (and thus skip) can 
have an effect on values of both macro_ptr and buf_ptr. Thus 
decl_initializer_alloc should also manage buf_ptr if I'm not wrong.

The attached patch seems to work but it seems to me that the buffer associated 
with buf_ptr doesn't hold the whole parsed source file so in some cases the 
buf_ptr = mem_bufptr line could be not enough (I mean the content of buf_ptr 
should also be saved).

Also I don't understand why macro_ptr = init_str.str; is used instead of 
restore_parse_state(&saved_parse_state);

So, (if I'm right) the patch should probably replaces those lines and add a 
backup of file->buf_ptr and the content of file->buffer.

Again, if I'm just completely wrong, please apologize.

Best regards,

Thomas Preud'homme
> 
> Thanks for reporting this issue!
> 
> On Tue, Aug 31, 2010 at 6:57 AM, Thomas Preud'homme <address@hidden> 
wrote:
> > Le lundi 30 août 2010 20:32:01, vous avez écrit :
> >> Hi Thomas.
> >> 
> >> > Sorry but I can't reproduce the bug. I've just checked out the mob
> >> > branch and it does what it's suppose to do. Could you tell me what's
> >> > the latest commit in your local mob branch? Mine is
> >> > 9d347f87426aebabe4eb52207b2f9ea8d2274809 (latest commit when I wrote
> >> > this email).
> >> 
> >> I have this commit. I don't know if it's the latest. I did a "git pull"
> >> and "make clean ; make ; make install" and retested and I still have
> >> the problem.
> >> 
> >> I should have noted that this is on x86_64 linux (Fedora 12). Maybe it
> >> works OK on 32 bit x86 but not 64 bit?
> > 
> > Indeed I can reproduce it on a x86_64 linux so this is arch specific. So
> > let's debug ;)
> > 
> >> Thanks!
> >> 
> >> Arnold
> > 
> > Tom
> > 
> > _______________________________________________
> > Tinycc-devel mailing list
> > address@hidden
> > http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Attachment: braces.patch
Description: Text Data

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


reply via email to

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