This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_newASSIGNOP: fix on g++ builds
authorDavid Mitchell <davem@iabyn.com>
Sun, 25 Sep 2016 18:30:39 +0000 (19:30 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 4 Oct 2016 10:18:40 +0000 (11:18 +0100)
op.c: In function ‘OP* Perl_newASSIGNOP(PerlInterpreter*, I32, OP*, I32, OP*)’:
op.c:6605:15: error: jump to label ‘detach_split’ [-fpermissive]
               detach_split:
               ^
op.c:6631:22: note:   from here
                 goto detach_split;
                      ^
op.c:6584:30: note:   skips initialization of ‘PMOP* const pm’
                 PMOP * const pm = (PMOP*)right;

op.c

diff --git a/op.c b/op.c
index 613c8bf..86e1f0c 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6586,14 +6586,13 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
             {
                 /* @pkg or @lex or local @pkg' or 'my @lex' */
                 OP *tmpop;
-                PMOP * const pm = (PMOP*)right;
                 if (gvop) {
 #ifdef USE_ITHREADS
-                    pm->op_pmreplrootu.op_pmtargetoff
+                    ((PMOP*)right)->op_pmreplrootu.op_pmtargetoff
                         = cPADOPx(gvop)->op_padix;
                     cPADOPx(gvop)->op_padix = 0;       /* steal it */
 #else
-                    pm->op_pmreplrootu.op_pmtargetgv
+                    ((PMOP*)right)->op_pmreplrootu.op_pmtargetgv
                         = MUTABLE_GV(cSVOPx(gvop)->op_sv);
                     cSVOPx(gvop)->op_sv = NULL;        /* steal it */
 #endif
@@ -6601,7 +6600,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
                         left->op_private & OPpOUR_INTRO;
                 }
                 else {
-                    pm->op_pmreplrootu.op_pmtargetoff = left->op_targ;
+                    ((PMOP*)right)->op_pmreplrootu.op_pmtargetoff = left->op_targ;
                     left->op_targ = 0; /* steal it */
                     right->op_private |= OPpSPLIT_LEX;
                 }