diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-10-21 11:59:05 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-10-21 11:59:05 +0100 |
commit | c8b0cbae4027475c5e532bbdd2673bcb4dae0aa3 (patch) | |
tree | 1e04ea880511047c969ca93c02549c6b9d1b37f0 /toke.c | |
parent | 881d8f0a6e1bd66255692969be386aba9ffe8762 (diff) | |
download | perl-c8b0cbae4027475c5e532bbdd2673bcb4dae0aa3.tar.gz |
panic if S_utf16_textfilter() is called in block mode.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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" : "", |