From: Tony Cook Date: Tue, 1 Dec 2009 08:12:30 +0000 (+1100) Subject: -Dmad broken for c++ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5ca68648d92617d8e0deebbc877c24f91be5ce4d;p=p5sagit%2Fp5-mst-13.2.git -Dmad broken for c++ On Tue, Dec 01, 2009 at 08:22:38AM +0100, H.Merijn Brand wrote: > perly.y: In function 'int Perl_madparse(PerlInterpreter*)': > perly.y:335: error: cast from 'TOKEN*' to 'line_t' loses precision > perly.y:348: error: cast from 'TOKEN*' to 'line_t' loses precision > perly.y:430: error: cast from 'TOKEN*' to 'line_t' loses precision Uses the same mechanism used in if, unless to retrieve an ival set in toke.c Signed-off-by: H.Merijn Brand --- diff --git a/perly.y b/perly.y index 4e9908e..18e5875 100644 --- a/perly.y +++ b/perly.y @@ -332,7 +332,7 @@ cont : /* NULL */ /* Loops: while, until, for, and a bare block */ loop : label WHILE '(' remember texpr ')' mintro mblock cont { OP *innerop; - PL_parser->copline = (line_t)$2; + PL_parser->copline = (line_t)IVAL($2); $$ = block_end($4, newSTATEOP(0, PVAL($1), innerop = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -345,7 +345,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont | label UNTIL '(' remember iexpr ')' mintro mblock cont { OP *innerop; - PL_parser->copline = (line_t)$2; + PL_parser->copline = (line_t)IVAL($2); $$ = block_end($4, newSTATEOP(0, PVAL($1), innerop = newWHILEOP(0, 1, (LOOP*)(OP*)NULL, @@ -427,7 +427,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont /* Switch blocks */ switch : label GIVEN '(' remember mydefsv mexpr ')' mblock - { PL_parser->copline = (line_t) $2; + { PL_parser->copline = (line_t) IVAL($2); $$ = block_end($4, newSTATEOP(0, PVAL($1), newGIVENOP($6, scope($8),