From: Gerard Goossen Date: Wed, 21 Mar 2007 19:18:52 +0000 (+0100) Subject: fix MAD compilation of C-style for loop X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=700f8fa57dd2ddf62360a5b615a799f680e4bf19;p=p5sagit%2Fp5-mst-13.2.git fix MAD compilation of C-style for loop Subject: [PATCH] MAD C-style for loop Message-Id: <20070321181852.GD31539@ostwald> p4raw-id: //depot/perl@30676 --- diff --git a/perly.act b/perly.act index 8d4b5f8..02aa650 100644 --- a/perly.act +++ b/perly.act @@ -325,7 +325,7 @@ case 2: forop = newUNOP(OP_NULL, 0, append_elem(OP_LINESEQ, newSTATEOP(0, CopLABEL_alloc(((ps[(1) - (12)].val.p_tkval))->tk_lval.pval), - ((ps[(5) - (12)].val.opval) ? newOP(OP_NULL, 0) : (ps[(5) - (12)].val.opval)) ), + ((ps[(5) - (12)].val.opval) ? (ps[(5) - (12)].val.opval) : newOP(OP_NULL, 0)) ), forop)); token_getmad((ps[(2) - (12)].val.i_tkval),forop,'3'); diff --git a/perly.y b/perly.y index 2abf7a1..9ca64a8 100644 --- a/perly.y +++ b/perly.y @@ -391,7 +391,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont forop = newUNOP(OP_NULL, 0, append_elem(OP_LINESEQ, newSTATEOP(0, CopLABEL_alloc(($1)->tk_lval.pval), - ($5 ? newOP(OP_NULL, 0) : $5) ), + ($5 ? $5 : newOP(OP_NULL, 0)) ), forop)); token_getmad($2,forop,'3');