develooper Front page | perl.perl5.porters | Postings from November 2014

[perl #123110] [PATCH 3/3] op.c: simplfy OP_AELEMFAST_LEX vs OP_AELEMFAST

From:
Jim Cromie
Date:
November 2, 2014 21:03
Subject:
[perl #123110] [PATCH 3/3] op.c: simplfy OP_AELEMFAST_LEX vs OP_AELEMFAST
Message ID:
rt-4.0.18-20693-1414962154-1496.123110-75-0@perl.org
# New Ticket Created by  Jim Cromie 
# Please include the string:  [perl #123110]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123110 >


in Perl_rpeep, remove special handling of OP_AELEMFAST_LEX vs OP_AELEMFAST.

Because PL_ppaddr[OP_AELEMFAST_LEX] == PL_ppaddr[OP_AELEMFAST] due to
regen/opcode.pl @raw_alias, both op_type branches result in same
postcondition: o->op_ppaddr == PL_ppaddr[o->op_type]
So its clearer to use the code construct that implies it.
---
 op.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/op.c b/op.c
index f259e68..de5f93d 100644
--- a/op.c
+++ b/op.c
@@ -12282,15 +12282,14 @@ Perl_rpeep(pTHX_ OP *o)
 		    op_null(pop);
 		    o->op_flags |= pop->op_next->op_flags & OPf_MOD;
 		    o->op_next = pop->op_next->op_next;
-		    o->op_ppaddr = PL_ppaddr[OP_AELEMFAST];
 		    o->op_private = (U8)i;
 		    if (o->op_type == OP_GV) {
 			gv = cGVOPo_gv;
 			GvAVn(gv);
-			o->op_type = OP_AELEMFAST;
+                        CHANGE_TYPE(o, OP_AELEMFAST);
 		    }
 		    else
-			o->op_type = OP_AELEMFAST_LEX;
+                        CHANGE_TYPE(o, OP_AELEMFAST_LEX);
 		}
 		if (o->op_type != OP_GV)
 		    break;
-- 
1.8.3.1




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About