[perl #34661] [BUG] Unicode String Literal, assert failure

2 views
Skip to first unread message

Will Coleda

unread,
Apr 3, 2005, 2:20:08 PM4/3/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Will Coleda
# Please include the string: [perl #34661]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34661 >


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.


Leopold Toetsch

unread,
Apr 4, 2005, 3:53:30 AM4/4/05
to perl6-i...@perl.org
Will Coleda <parrotbug...@parrotcode.org> wrote:

> .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

Reply all
Reply to author
Forward
0 new messages