[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] tricky little bounds-checking bug
From: |
Joe Soroka |
Subject: |
[Tinycc-devel] tricky little bounds-checking bug |
Date: |
Fri, 25 Mar 2011 00:23:34 -0700 |
---------------------
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
preprocess_new().
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?
- [Tinycc-devel] tricky little bounds-checking bug,
Joe Soroka <=