This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move $RETVAL_code into $self.
[perl5.git] / dist / ExtUtils-ParseXS / lib / ExtUtils / ParseXS.pm
index 218e8d3..a5ca2d0 100644 (file)
@@ -42,7 +42,7 @@ our (
   @line_no, 
   %XsubAliases, %XsubAliasValues, %Interfaces, @Attributes, %outargs, 
   $condnum, $cond,
   @line_no, 
   %XsubAliases, %XsubAliasValues, %Interfaces, @Attributes, %outargs, 
   $condnum, $cond,
-  $RETVAL_code, $func_args, @XSStack, $ALIAS, 
+  $func_args, @XSStack, $ALIAS, 
 );
 our ($DoSetMagic, $newXS, $proto, $Module_cname, $XsubAliases, $Interfaces, $var_num, );
 
 );
 our ($DoSetMagic, $newXS, $proto, $Module_cname, $XsubAliases, $Interfaces, $var_num, );
 
@@ -763,7 +763,7 @@ EOF
 
       # do output variables
       $self->{gotRETVAL} = 0;        # 1 if RETVAL seen in OUTPUT section;
 
       # do output variables
       $self->{gotRETVAL} = 0;        # 1 if RETVAL seen in OUTPUT section;
-      undef $RETVAL_code ;    # code to set RETVAL (from OUTPUT section);
+      undef $self->{RETVAL_code} ;    # code to set RETVAL (from OUTPUT section);
       # $wantRETVAL set if 'RETVAL =' autogenerated
       ($wantRETVAL, $self->{ret_type}) = (0, 'void') if $RETVAL_no_return;
       undef %outargs;
       # $wantRETVAL set if 'RETVAL =' autogenerated
       ($wantRETVAL, $self->{ret_type}) = (0, 'void') if $RETVAL_no_return;
       undef %outargs;
@@ -778,8 +778,8 @@ EOF
       } ) for grep $in_out{$_} =~ /OUT$/, keys %in_out;
 
       # all OUTPUT done, so now push the return value on the stack
       } ) for grep $in_out{$_} =~ /OUT$/, keys %in_out;
 
       # all OUTPUT done, so now push the return value on the stack
-      if ($self->{gotRETVAL} && $RETVAL_code) {
-        print "\t$RETVAL_code\n";
+      if ($self->{gotRETVAL} && $self->{RETVAL_code}) {
+        print "\t$self->{RETVAL_code}\n";
       }
       elsif ($self->{gotRETVAL} || $wantRETVAL) {
         my $t = $args{optimize} && $targetable{$type_kind{$self->{ret_type}}};
       }
       elsif ($self->{gotRETVAL} || $wantRETVAL) {
         my $t = $args{optimize} && $targetable{$type_kind{$self->{ret_type}}};
@@ -1228,7 +1228,7 @@ sub OUTPUT_handler {
       if $outargs{$outarg}++;
     if (!$self->{gotRETVAL} and $outarg eq 'RETVAL') {
       # deal with RETVAL last
       if $outargs{$outarg}++;
     if (!$self->{gotRETVAL} and $outarg eq 'RETVAL') {
       # deal with RETVAL last
-      $RETVAL_code = $outcode;
+      $self->{RETVAL_code} = $outcode;
       $self->{gotRETVAL} = 1;
       next;
     }
       $self->{gotRETVAL} = 1;
       next;
     }