summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-02-06 09:20:04 +0000
committerDavid Mitchell <davem@iabyn.com>2017-02-06 09:32:18 +0000
commitadd424dabf9dadd0817fac9b1bf4c5d4e8bbd196 (patch)
treeb5cf7fc17e8af63a6325a1e61939860477e27eb7 /util.c
parentda1ec2b1b9abdfd956d9c539abf39d908d046304 (diff)
downloadperl-add424dabf9dadd0817fac9b1bf4c5d4e8bbd196.tar.gz
Perl_fbm_instr(): remove dead code.
For the case where littlestr hasn't been FBM compiled (!SvVALID()), it can't be SvTAIL(), so there's no need for optional \n handling. Spotted by Coverity.
Diffstat (limited to 'util.c')
-rw-r--r--util.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/util.c b/util.c
index 53b410971a..efe4c02b63 100644
--- a/util.c
+++ b/util.c
@@ -951,16 +951,7 @@ Perl_fbm_instr(pTHX_ unsigned char *big, unsigned char *bigend, SV *littlestr, U
char * const b = ninstr((char*)big,(char*)bigend,
(char*)little, (char*)little + littlelen);
- if (!b && tail) { /* Automatically multiline! */
- /* Chop \n from littlestr: */
- s = bigend - littlelen + 1;
- if (*s == *little
- && memEQ((char*)s + 1, (char*)little + 1, littlelen - 2))
- {
- return (char*)s;
- }
- return NULL;
- }
+ assert(!tail); /* valid => FBM; tail only set on SvVALID SVs */
return b;
}