Hi,

On Sun, 3 Apr 2016, Sergey Korshunoff wrote:

The previous trace is wrong, sorry
A correct place is

 else if (tok == '{') {
    if (const_wanted)
        tcc_error("expected constant");
    /* save all registers */
    save_regs(0); <<<<<<<<<<<<<<<
    /* statement expression : we do not accept break/continue
       inside as GCC does */
    block(NULL, NULL, NULL, NULL, 0, 1);
    skip(')');
} else {
    gexpr();
    skip(')');
}

This is a save_regs(0) which generate a code when nocode_wanted=1
When
  if(!nocode_wanted)
    save_regs(0);
then there is no error messages but a test program still hangs

Of course, because the whole parsing of the ({block}) still generates code. The nocode_wanted hack currently doesn't work for statement expressions, and as Edmund says deserves a little thought if it's applied at the right level currently (well I think it's clear that it isn't, but the question what the right level is remains).


Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to