@@ -1649,12 +1649,12 @@ sub as_output_code {
1649
1649
1650
1650
if ( $pxs -> {config_optimize }
1651
1651
&& ExtUtils::Typemaps::OutputMap-> targetable($evalexpr )
1652
- && !$xbody -> {targ_used })
1652
+ && !$xbody -> {output_part }{ targ_used })
1653
1653
{
1654
1654
# So TARG is available for use.
1655
1655
$retvar = ' TARG' ;
1656
1656
# can only use TARG to return one value
1657
- $xbody -> {targ_used } = 1;
1657
+ $xbody -> {output_part }{ targ_used } = 1;
1658
1658
1659
1659
# Since we're using TARG for the return SV, see if we can use
1660
1660
# the TARG[iun] macros as appropriate to speed up setting it.
@@ -2254,11 +2254,6 @@ BEGIN { $build_subclass->('', # parent
2254
2254
' OUTPUT_SETMAGIC_state' , # Bool: most recent value of SETMAGIC in an
2255
2255
# OUTPUT section.
2256
2256
2257
-
2258
- # State during code emitting
2259
-
2260
- ' targ_used' , # Bool: the TARG has been allocated for this body,
2261
- # so is no longer available for use.
2262
2257
)};
2263
2258
2264
2259
@@ -2317,9 +2312,6 @@ sub as_code {
2317
2312
my ExtUtils::ParseXS $pxs = shift ;
2318
2313
my ExtUtils::ParseXS::Node::xsub $xsub = shift ;
2319
2314
2320
- # TARG is available for use within this body.
2321
- $self -> {targ_used } = 0;
2322
-
2323
2315
# Emit opening brace. With cmd-line switch "-except", prefix it with 'TRY'
2324
2316
print +($pxs -> {config_allow_exceptions } ? ' TRY' : ' ' )
2325
2317
. " $open_brace \n " ;
@@ -2590,6 +2582,11 @@ sub as_code {
2590
2582
package ExtUtils::ParseXS::Node::output_part ;
2591
2583
2592
2584
BEGIN { $build_subclass -> (' ' , # parent
2585
+
2586
+ # State during code emitting
2587
+
2588
+ ' targ_used' , # Bool: the TARG has been allocated for this body,
2589
+ # so is no longer available for use.
2593
2590
)};
2594
2591
2595
2592
@@ -2621,6 +2618,9 @@ sub as_code {
2621
2618
my ExtUtils::ParseXS::Node::xsub $xsub = shift ;
2622
2619
my ExtUtils::ParseXS::Node::xbody $xbody = shift ;
2623
2620
2621
+ # TARG is available for use within this body.
2622
+ $self -> {targ_used } = 0;
2623
+
2624
2624
if ($self -> {kids }) {
2625
2625
$_ -> as_code($pxs , $xsub , $xbody ) for @{$self -> {kids }};
2626
2626
}
0 commit comments