On Saturday, 3 December 2016 at 23:30:58 UTC, Stefan Koch wrote:
Another bug in continue break handling has appeared.

uint fn() {
  for (;;)
  {
    if (true) break;
    return 0;
  }
  return 1;
}

static assert(fn());

The above code is enough to trigger it.
Apparently the fixup jump for the break is never inserted.
I doubt that this is an off-by-one error again.

It's going to be tricky.

I figured out part of the reason for this bug.
baically it's like this.


uint fn() {
  for (;;)
beginBlock:
//causes and unconditonal jump (UC1) after the end of the block
  {
    if (true) break;
// causes an unconditional jump(UC2) here to the end of the block
UC2: goto endBlock;
    return 0;
endBlock:
UC1: goto BeginBlock;
  }
  return 1;
}

Reply via email to