diff options
author | Hugo van der Sanden <hv@crypt.org> | 1999-06-23 18:27:42 +0100 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-23 17:24:42 +0000 |
commit | 7399586d384137f7ae66bcc82a83b0df7dd429e5 (patch) | |
tree | 0614d50805aadb4a38255926340fe1c5a3bdeff8 /op.c | |
parent | 59af01353dbbede40ae5b5d1b0330b847ffb82dc (diff) | |
download | perl-7399586d384137f7ae66bcc82a83b0df7dd429e5.tar.gz |
applied suggested patch for tracking line numbers correctly in
optimized blocks with a single statement; changed setcop to
setstate and added code for -Dx dumps
Message-Id: <199906231627.RAA24033@crypt.compulink.co.uk>
Subject: [PATCH 5.005_57] Line number error in optimised else()
p4raw-id: //depot/perl@3728
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -685,6 +685,9 @@ Perl_op_free(pTHX_ OP *o) case OP_AELEMFAST: SvREFCNT_dec(cGVOPo->op_gv); break; + case OP_SETSTATE: + o->op_targ = 0; /* Was holding old type. */ + /* FALL THROUGH */ case OP_NEXTSTATE: case OP_DBSTATE: cop_free((COP*)o); @@ -739,6 +742,8 @@ S_cop_free(pTHX_ COP* cop) STATIC void S_null(pTHX_ OP *o) { + if (o->op_type == OP_NEXTSTATE || o->op_type == OP_DBSTATE) + cop_free((COP*)o); if (o->op_type != OP_NULL && o->op_type != OP_THREADSV && o->op_targ > 0) pad_free(o->op_targ); o->op_targ = o->op_type; @@ -1685,8 +1690,11 @@ Perl_scope(pTHX_ OP *o) o->op_ppaddr = PL_ppaddr[OP_SCOPE]; kid = ((LISTOP*)o)->op_first; if (kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE){ - cop_free((COP*)kid); - null(kid); + if (kid->op_targ > 0) + pad_free(kid->op_targ); + kid->op_targ = kid->op_type; + kid->op_type = OP_SETSTATE; + kid->op_ppaddr = PL_ppaddr[OP_SETSTATE]; } } else |