From b9709a1ca404cae3dcb1e0933525dca7852c6c4a Mon Sep 17 00:00:00 2001 From: "James E. Keenan" Date: Sun, 14 Mar 2010 10:39:48 -0400 Subject: [PATCH] Change $ALIAS from 'my' to 'our' This is not because I think it really should be changed but because declaring it as 'my' produces change in resulting C code -- albeit probably a desirable change. Include summary of debugging as inline comment. --- dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm index e47457d..e458cac 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm @@ -39,7 +39,7 @@ our ( @line_no, $ret_type, $func_name, $Full_func_name, $Packprefix, $Packid, %XsubAliases, %XsubAliasValues, %Interfaces, @Attributes, %outargs, $pname, $thisdone, $retvaldone, $deferred, $gotRETVAL, $condnum, $cond, - $RETVAL_code, $name_printed, $func_args, @XSStack, + $RETVAL_code, $name_printed, $func_args, @XSStack, $ALIAS, ); #our $DoSetMagic; @@ -632,7 +632,21 @@ EOF # to set explicit return values. my $EXPLICIT_RETURN = ($CODE && ("@line" =~ /(\bST\s*\([^;]*=) | (\bXST_m\w+\s*\()/x )); - my $ALIAS = grep(/^\s*ALIAS\s*:/, @line); + + # In principle, the following $ALIAS ought to be a lexical, i.e., 'my + # $ALIAS' like the other nearby variables. However, implementing that + # change produced a slight difference in the resulting .c output in at + # least two distributions: B/BD/BDFOY/Crypt-Rijndael and + # G/GF/GFUJI/Hash-FieldHash. The difference is, arguably, an improvement + # in the resulting C code. Example: + # 388c388 + # < GvNAME(CvGV(cv)), + # --- + # > "Crypt::Rijndael::encrypt", + # But at this point we're committed to generating the *same* C code that + # the current version of ParseXS.pm does. So we're declaring it as 'our'. + $ALIAS = grep(/^\s*ALIAS\s*:/, @line); + my $INTERFACE = grep(/^\s*INTERFACE\s*:/, @line); $xsreturn = 1 if $EXPLICIT_RETURN; -- 2.7.4