From: Nicholas Clark <nick@ccl4.org>
Date: Wed, 12 Sep 2007 23:10:58 +0000 (+0000)
Subject: Add the missing assignment to op_last that change 31798 missed out.
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=955623668f666142789ec391e521b0b6705cea7b;p=p5sagit%2Fp5-mst-13.2.git

Add the missing assignment to op_last that change 31798 missed out.
With this, state $zok = ...; will deparse.

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

diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index d0b18be..024f3eb 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -2557,6 +2557,14 @@ sub pp_cond_expr {
     return $head . join($cuddle, "", @elsifs) . $false;
 }
 
+sub pp_once {
+    my ($self, $op, $cx) = @_;
+    my $cond = $op->first;
+    my $true = $cond->sibling;
+
+    return $self->deparse($true, $cx);
+}
+
 sub loop_common {
     my $self = shift;
     my($op, $cx, $init) = @_;
diff --git a/op.c b/op.c
index 1ebc84c..d3fabf3 100644
--- a/op.c
+++ b/op.c
@@ -7065,6 +7065,11 @@ Perl_ck_sassign(pTHX_ OP *o)
 	    condop->op_targ = target;
 	    other->op_targ = target;
 
+	    /* Because we change the type of the op here, we will skip the
+	       assinment binop->op_last = binop->op_first->op_sibling; at the
+	       end of Perl_newBINOP(). So need to do it here. */
+	    cBINOPo->op_last = cBINOPo->op_first->op_sibling;
+
 	    return nullop;
 	}
     }