Skip to content

Commit

Permalink
try to make callframe().my.<$x> read-only
Browse files Browse the repository at this point in the history
It doesn't quite work, but it reduces the amount of damage
you can do to the caller's lexpad

Also run new callframe.t
  • Loading branch information
moritz committed Jun 13, 2010
1 parent ae1300f commit b931990
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/LexPad.pm
Expand Up @@ -4,7 +4,7 @@ class LexPad is Associative {

multi method postcircumfix:<{ }>($thing) {
Q:PIR {
.local pmc key
.local pmc key, false
key = find_lex '$thing'
$P0 = find_lex 'self'
$P1 = getattribute $P0, '$!parrot_lexpad'
Expand All @@ -13,6 +13,9 @@ class LexPad is Associative {
unless null %r goto done
%r = get_hll_global 'Mu'
done:
%r = clone %r
false = get_hll_global 'False'
setprop %r, 'rw', false
}
}

Expand Down
1 change: 1 addition & 0 deletions t/spectest.data
Expand Up @@ -315,6 +315,7 @@ S05-substitution/match.t
S05-substitution/subst.t
S05-transliteration/trans.t
# S05-transliteration/with-closure.t
S06-advanced_subroutine_features/callframe.t
S06-advanced_subroutine_features/lexical-subs.t
S06-advanced_subroutine_features/recurse.t
S06-advanced_subroutine_features/return.t
Expand Down

0 comments on commit b931990

Please sign in to comment.