Skip to content

Commit

Permalink
pkgop: fix const flags 64 back to 34 WANT_SCALAR,MOD not BARE
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Feb 20, 2012
1 parent f1df04a commit fd0853f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .perldb
@@ -1 +1,3 @@
$DB::deep=500; $DB::deep=500;
$SIG{__WARN__}='';
# a 934 print $op->name
16 changes: 8 additions & 8 deletions lib/B/C.pm
Expand Up @@ -507,7 +507,7 @@ sub svop_name {
$sv = $op->pmreplroot->sv; $sv = $op->pmreplroot->sv;
} else { } else {
$sv = $op->first->sv unless $op->flags & 4 $sv = $op->first->sv unless $op->flags & 4
or ($op->name eq 'const' and $op->flags & 64) or $op->first->can("sv"); or ($op->name eq 'const' and $op->flags & 34) or $op->first->can("sv");
} }
} else { } else {
$sv = $op->sv; $sv = $op->sv;
Expand All @@ -533,8 +533,8 @@ sub svop_name {
} }
} }


# Returns a SVOP->pv (const pv mostly). for the symbol and stash name see svop_name # Returns a SVOP->pv (const PV or method_named PV mostly). for the symbol and stash name see svop_name
# 1. called from method_named to get the pv # 1. called from check_entersub/method_named to get the pv
# 2. called from svop before method/method_named to cache the $package_pv # 2. called from svop before method/method_named to cache the $package_pv
sub svop_pv { sub svop_pv {
my $op = shift; my $op = shift;
Expand All @@ -548,7 +548,7 @@ sub svop_pv {
$sv = $op->pmreplroot->sv; $sv = $op->pmreplroot->sv;
} else { } else {
$sv = $op->first->sv unless $op->flags & 4 $sv = $op->first->sv unless $op->flags & 4
or ($op->name eq 'const' and $op->flags & 64) or $op->first->can("sv"); or ($op->name eq 'const' and $op->flags & 34) or $op->first->can("sv");
} }
} else { } else {
$sv = $op->sv; $sv = $op->sv;
Expand Down Expand Up @@ -847,10 +847,10 @@ sub check_entersub {
if ($op->type > 0 and if ($op->type > 0 and
$op->name eq 'entersub' and $op->first and $op->first->can('name') and $op->name eq 'entersub' and $op->first and $op->first->can('name') and
$op->first->name eq 'pushmark' and $op->first->name eq 'pushmark' and
# Foo->bar() compile-time lookup, 64 = BARE in all versions # Foo->bar() compile-time lookup, 34 WANT_SCALAR,MOD in all versions
(($op->first->next->name eq 'const' and $op->first->next->flags == 64) (($op->first->next->name eq 'const' and $op->first->next->flags == 34)
# or $foo->bar() run-time lookup # or $foo->bar() run-time lookup
or $op->first->next->name eq 'padsv')) # note that padsv is called gvsv in Concise or $op->first->next->name eq 'padsv')) # note that padsv is called gvsv in Concise
{ {
my $pkgop = $op->first->next; # padsv for objects or const for classes my $pkgop = $op->first->next; # padsv for objects or const for classes
my $methop = $pkgop; # walk args until method or sub end. This ends my $methop = $pkgop; # walk args until method or sub end. This ends
Expand Down

0 comments on commit fd0853f

Please sign in to comment.