From: Stephen McCamant <smcc@mit.edu>
Date: Sun, 22 Dec 2002 22:09:51 +0000 (-0500)
Subject: Re: [perl #19061] 'goto' confuses 'redo'
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed8d0fe2473523a42189f0c3b912e68bf4ca9b1b;p=p5sagit%2Fp5-mst-13.2.git

Re: [perl #19061] 'goto' confuses 'redo'
Message-ID: <15878.32383.94274.950128@syllepsis.MIT.EDU>

p4raw-id: //depot/perl@18411
---

diff --git a/pp_ctl.c b/pp_ctl.c
index 623b1ce..bb576d5 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2048,11 +2048,15 @@ S_dofindlabel(pTHX_ OP *o, char *label, OP **opstack, OP **oplimit)
 	for (kid = cUNOPo->op_first; kid; kid = kid->op_sibling) {
 	    if (kid == PL_lastgotoprobe)
 		continue;
-	    if ((kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE) &&
-		(ops == opstack ||
-		 (ops[-1]->op_type != OP_NEXTSTATE &&
-		  ops[-1]->op_type != OP_DBSTATE)))
-		*ops++ = kid;
+	    if (kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE) {
+	        if (ops == opstack)
+		    *ops++ = kid;
+		else if (ops[-1]->op_type == OP_NEXTSTATE ||
+		         ops[-1]->op_type == OP_DBSTATE)
+		    ops[-1] = kid;
+		else
+		    *ops++ = kid;
+	    }
 	    if ((o = dofindlabel(kid, label, ops, oplimit)))
 		return o;
 	}