diff options
author | David Mitchell <davem@iabyn.com> | 2015-02-26 15:44:04 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2015-02-26 15:44:04 +0000 |
commit | 952684692c4740b541017b64502f76660a55c57b (patch) | |
tree | 4ca60ad58fa8058c1b2f524118922343c696c8ed /dump.c | |
parent | 55acc4e8965e74959640ece8bb7247be97fd4bd0 (diff) | |
download | perl-952684692c4740b541017b64502f76660a55c57b.tar.gz |
do_op_dump(): handle unknown op_private enums
Where a bitfield value in op_private doesn't correspond to any enums,
do_op_dump() is supposed to display the value as an integer (with
optional LABEL= prefix). Concise does this, do_op_dump was failing to
do this, and instead trying to display the value symbolically as string at
offset -1 in PL_op_private_labels.
This wasn't important yet as no ops currently have an unspecified enum
value.
Spotted by Coverity.
Diffstat (limited to 'dump.c')
-rw-r--r-- | dump.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -905,7 +905,10 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o) sv_catpv(tmpsv, &PL_op_private_labels[label]); sv_catpv(tmpsv, "="); } - sv_catpv(tmpsv, &PL_op_private_labels[enum_label]); + if (enum_label == -1) + Perl_sv_catpvf(aTHX_ tmpsv, "0x%"UVxf, (UV)val); + else + sv_catpv(tmpsv, &PL_op_private_labels[enum_label]); } else { |