This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A fig leaf for calling sv_pos_u2b with IV* where it expects I32*.
[perl5.git]
/
pp.c
diff --git
a/pp.c
b/pp.c
index
c659b13
..
089401b
100644
(file)
--- a/
pp.c
+++ b/
pp.c
@@
-3079,12
+3079,12
@@
PP(pp_substr)
{
dVAR; dSP; dTARGET;
SV *sv;
{
dVAR; dSP; dTARGET;
SV *sv;
- I
32
len = 0;
+ I
V
len = 0;
STRLEN curlen;
STRLEN utf8_curlen;
STRLEN curlen;
STRLEN utf8_curlen;
- I
32
pos;
- I
32
rem;
- I
32
fail;
+ I
V
pos;
+ I
V
rem;
+ I
V
fail;
const I32 lvalue = PL_op->op_flags & OPf_MOD || LVRET;
const char *tmps;
const I32 arybase = CopARYBASE_get(PL_curcop);
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;
rem = curlen;
else if (len >= 0) {
rem = pos+len;
- if (rem > (I
32
)curlen)
+ if (rem > (I
V
)curlen)
rem = curlen;
}
else {
rem = curlen;
}
else {
@@
-3167,10
+3167,13
@@
PP(pp_substr)
RETPUSHUNDEF;
}
else {
RETPUSHUNDEF;
}
else {
- const I32 upos = pos;
- const I32 urem = rem;
+ 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.
+ */
if (utf8_curlen)
if (utf8_curlen)
- sv_pos_u2b(sv,
&pos,
&rem);
+ sv_pos_u2b(sv,
(I32 *)&pos, (I32 *)
&rem);
tmps += pos;
/* we either return a PV or an LV. If the TARG hasn't been used
* before, or is of that type, reuse it; otherwise use a mortal
tmps += pos;
/* we either return a PV or an LV. If the TARG hasn't been used
* before, or is of that type, reuse it; otherwise use a mortal