From 952684692c4740b541017b64502f76660a55c57b Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Thu, 26 Feb 2015 15:44:04 +0000 Subject: 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. --- dump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dump.c') diff --git a/dump.c b/dump.c index 9587668865..8d2f95b091 100644 --- a/dump.c +++ b/dump.c @@ -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 { -- cgit v1.2.1