diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-01-18 07:29:50 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-01-18 07:52:41 +0100 |
commit | 54fcd2cd405902c42b2f46e5110b540f83c77028 (patch) | |
tree | 9807b1e7e2fd09c76ec2e03d6a9ea0767106cb51 /pp.c | |
parent | c25e53bef71ab0f21ff2b53e7adf829f605eadad (diff) | |
download | perl-54fcd2cd405902c42b2f46e5110b540f83c77028.tar.gz |
Revert "[perl #62646] Maximum string length with substr"
This reverts commit b6d1426f94a845fb8fece8b6ad0b7d9f35f2d62e.
Conflicts:
pp.c
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -3079,12 +3079,12 @@ PP(pp_substr) { dVAR; dSP; dTARGET; SV *sv; - IV len = 0; + I32 len = 0; STRLEN curlen; STRLEN utf8_curlen; - IV pos; - IV rem; - IV fail; + I32 pos; + I32 rem; + I32 fail; const I32 lvalue = PL_op->op_flags & OPf_MOD || LVRET; const char *tmps; const I32 arybase = CopARYBASE_get(PL_curcop); @@ -3147,7 +3147,7 @@ PP(pp_substr) rem = curlen; else if (len >= 0) { rem = pos+len; - if (rem > (IV)curlen) + if (rem > (I32)curlen) rem = curlen; } else { @@ -3167,11 +3167,8 @@ PP(pp_substr) RETPUSHUNDEF; } else { - const IV upos = pos; - const IV urem = rem; - /* FIXME -- if an IV is longer than an I32, we're truncating here, - * but a 64-bit version of sv_pos_u2b is not (yet) available. - */ + const I32 upos = pos; + const I32 urem = rem; if (utf8_curlen) sv_pos_u2b(sv, (I32 *)&pos, (I32 *)&rem); tmps += pos; |