summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-21 11:59:05 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-21 11:59:05 +0100
commitc8b0cbae4027475c5e532bbdd2673bcb4dae0aa3 (patch)
tree1e04ea880511047c969ca93c02549c6b9d1b37f0 /toke.c
parent881d8f0a6e1bd66255692969be386aba9ffe8762 (diff)
downloadperl-c8b0cbae4027475c5e532bbdd2673bcb4dae0aa3.tar.gz
panic if S_utf16_textfilter() is called in block mode.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index d3d32ebf71..40310445b7 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" : "",