Skip to content

Commit

Permalink
Handle named subs as readonlies
Browse files Browse the repository at this point in the history
-20K testsuite
  • Loading branch information
sorear committed Aug 17, 2010
1 parent 2fa3d4e commit c766146
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Decl.pm
Expand Up @@ -60,7 +60,7 @@ use CgOp;
sub bodies { $_[0]->code }

sub used_slots {
[$_[0]->var, 'Variable', $_[1] ? 1 : 0];
[$_[0]->var, 'Variable', $_[1] ? 3 : 0];
}

sub preinit_code {
Expand All @@ -69,7 +69,9 @@ use CgOp;
$body->needs_protovars ?
CgOp::prog(
CgOp::protosub($self->code),
CgOp::proto_var($self->var, CgOp::sub_var($self->code))) :
CgOp::proto_var($self->var,
$body->mainline ? CgOp::sub_obj($self->code)
: CgOp::sub_var($self->code))) :
CgOp::protosub($self->code);
}

Expand Down

0 comments on commit c766146

Please sign in to comment.