Hi,

On Fri, 11 Mar 2016, Michael Matz wrote:

it's now "size += -1 * 4 + 1" (i.e. +=3).

-=3 of course, but you got the idea :)

So, I think it's more correct to special case the ref->c == -1 case only (don't adjust size in that case), instead of playing +-1 tricks (as in, it's not a off-by-one error). Will think a bit over dinner :)

After dinner I still agree with me :)  Pushed with a testcase.

This whole thing also points out some deficiencies of tcc to emit error messages. For instance it accepts the initialization

void f(void) {
  struct w q = {"bugs", { 'c' } };
}

(and sets ref->c to 1), even though this is a non-static initialization, which is wrong (but the size adjustments needs also to be done for static initialization). Probably this code can be simplified somewhat, but that's for somewhen else.


Ciao,
Michael.

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to