summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-11-13 11:50:14 +0000
committerDavid Mitchell <davem@iabyn.com>2017-11-13 12:23:24 +0000
commitca84e88ece180337b1ea0b8a2b9d4211b1089878 (patch)
tree33357866fab2b784f00f423ff3ad0000c484108d /dump.c
parentb5bf9f73a7cc9feabf29609f45df824fed127956 (diff)
downloadperl-ca84e88ece180337b1ea0b8a2b9d4211b1089878.tar.gz
change OP_MULTICONCAT nargs from UV to SSize_t
Change it from unsigned to unsigned since it makes the SP-adjusting code in pp_multiconcat easier without hitting undefined behaviour (RT #132390); and change its size from UV to SSize_t since it represents the number of args on the stack.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/dump.c b/dump.c
index 5dac007825..b2f0fc5ef2 100644
--- a/dump.c
+++ b/dump.c
@@ -1142,8 +1142,8 @@ S_do_op_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, const OP *o)
}
case OP_MULTICONCAT:
- S_opdump_indent(aTHX_ o, level, bar, file, "NARGS = %" UVuf "\n",
- cUNOP_AUXo->op_aux[PERL_MULTICONCAT_IX_NARGS].uv);
+ S_opdump_indent(aTHX_ o, level, bar, file, "NARGS = %" IVdf "\n",
+ (IV)cUNOP_AUXo->op_aux[PERL_MULTICONCAT_IX_NARGS].ssize);
/* XXX really ought to dump each field individually,
* but that's too much like hard work */
S_opdump_indent(aTHX_ o, level, bar, file, "CONSTS = (%" SVf ")\n",
@@ -2749,13 +2749,13 @@ Perl_multiconcat_stringify(pTHX_ const OP *o)
UNOP_AUX_item *aux = cUNOP_AUXo->op_aux;
UNOP_AUX_item *lens;
STRLEN len;
- UV nargs;
+ SSize_t nargs;
char *s;
SV *out = newSVpvn_flags("", 0, SVs_TEMP);
PERL_ARGS_ASSERT_MULTICONCAT_STRINGIFY;
- nargs = aux[PERL_MULTICONCAT_IX_NARGS].uv;
+ nargs = aux[PERL_MULTICONCAT_IX_NARGS].ssize;
s = aux[PERL_MULTICONCAT_IX_PLAIN_PV].pv;
len = aux[PERL_MULTICONCAT_IX_PLAIN_LEN].ssize;
if (!s) {
@@ -2770,8 +2770,7 @@ Perl_multiconcat_stringify(pTHX_ const OP *o)
|PERL_PV_PRETTY_ELLIPSES));
lens = aux + PERL_MULTICONCAT_IX_LENGTHS;
- nargs++;
- while (nargs-- > 0) {
+ while (nargs-- >= 0) {
Perl_sv_catpvf(aTHX_ out, ",%" IVdf, (IV)lens->ssize);
lens++;
}