Tripped over this while implementing unicode support for Tcl:
.sub main @MAIN
$S0 = unicode:"\"]\nif I3 == "
.end
Generates:
encodings/utf8.c:277: failed assertion `i->bytepos < PObj_buflen(s) - 4'
Abort trap
This bug is pretty fragile. Removing the "\n" or the "if ", the program compiles fine. (Changing the \n to an n, however, does keep the error.)
Two things:
1) The error itself.
2) The fact that the diagnostic shows up in encodings/utf8.c, rather than being caught and showing up on line 2 of my PIR code.
> .sub main @MAIN
> $S0 = unicode:"\"]\nif I3 == "
> .end
> Generates:
> encodings/utf8.c:277: failed assertion `i->bytepos < PObj_buflen(s) - 4'
Slightly wrong assert. I've moved it after the advance of the bytepos
now.
> 2) The fact that the diagnostic shows up in encodings/utf8.c, rather
> than being caught and showing up on line 2 of my PIR code.
It's a C assert and not an exception, but it probably should be an
exception, yes.
leo