From: Nicholas Clark Date: Wed, 21 Oct 2009 10:59:05 +0000 (+0100) Subject: panic if S_utf16_textfilter() is called in block mode. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8b0cbae4027475c5e532bbdd2673bcb4dae0aa3;p=p5sagit%2Fp5-mst-13.2.git panic if S_utf16_textfilter() is called in block mode. --- diff --git a/toke.c b/toke.c index d3d32eb..4031044 100644 --- a/toke.c +++ b/toke.c @@ -12777,6 +12777,13 @@ S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen) const STRLEN old = SvCUR(sv); const I32 count = FILTER_READ(idx+1, sv, maxlen); const bool reverse = IoLINES(sv); + + /* As we're automatically added, at the lowest level, and hence only called + from this file, we can be sure that we're not called in block mode. Hence + don't bother writing code to deal with block mode. */ + if (maxlen) { + Perl_croak(aTHX_ "panic: utf16_textfilter called in block mode (for %d characters)", maxlen); + } DEBUG_P(PerlIO_printf(Perl_debug_log, "utf16%s_textfilter(%p): %d %d (%d)\n", reverse ? "rev" : "",