[Top][All Lists]

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

Re: [Tinycc-devel] tricky little bounds-checking bug

From: grischka
Subject: Re: [Tinycc-devel] tricky little bounds-checking bug
Date: Sat, 26 Mar 2011 13:13:39 +0100
User-agent: Thunderbird (Windows/20100228)

Joe Soroka wrote:
char xyz[123];

void main(void)
    int i = 0;
    xyz[0] = !i;

This comes from trying to get tcc to run itself with bounds-checking
turned on.  This is a reduced form of "init isid table" in

Looking at the disassembly, it seems that the '!' operator causes a
register to be stomped on.  Some other expressions do the same thing,
like "i || 1".

I've tried to fix it, but I'm kinda lost in the bounds-checking logic.
 Anyone have any ideas?

I recall there was a similar problem without bounds-checking:
The patch is part of:
logged as:
    +  437: Call 'saveregs()' before jumping with logical and/or/not (grischka)

--- grischka

reply via email to

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