summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLarry Wall <larry@wall.org>1998-09-05 23:41:42 +0000
committerLarry Wall <larry@wall.org>1998-09-05 23:41:42 +0000
commit0b71040ecef552254b590fe9935cf4942b087ec2 (patch)
tree61b982de6211c6367522e3ecabf6ea3751416e97 /util.c
parent63eb823a4363c9bf0207de13bc5cc0828f38a135 (diff)
downloadperl-0b71040ecef552254b590fe9935cf4942b087ec2.tar.gz
index() applied BM optimization to wrong argument
p4raw-id: //depot/perl@1779
Diffstat (limited to 'util.c')
-rw-r--r--util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util.c b/util.c
index e079d420a0..5be4969e75 100644
--- a/util.c
+++ b/util.c
@@ -900,10 +900,11 @@ fbm_compile(SV *sv, U32 flags /* not used yet */)
register unsigned char *s;
register unsigned char *table;
register U32 i;
- register U32 len = SvCUR(sv);
+ STRLEN len;
I32 rarest = 0;
U32 frequency = 256;
+ s = SvPV_force(sv, len);
sv_upgrade(sv, SVt_PVBM);
if (len > 255 || len == 0) /* TAIL might be on on a zero-length string. */
return; /* can't have offsets that big */