summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-27 14:25:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-27 14:25:02 +0000
commite43d14725ff8dab7210988c1201779666fb4aa96 (patch)
tree54aeaa62241566fd1fdbcef815f5278431fe5a07 /parse.y
parent0f886f2f240ba3a56e03cce07b09eef06485a31a (diff)
* parse.y (dyna_var_lookup): should not alter dvar->val not to
destroy living value. [ruby-core:10076] * parse.y (dyna_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 1131801..d1a4d65 100644
--- a/parse.y
+++ b/parse.y
@@ -5733,6 +5733,8 @@ top_local_setup()
local_pop();
}
+#define DVAR_USED FL_USER6
+
static VALUE
dyna_var_lookup(id)
ID id;
@@ -5741,7 +5743,7 @@ dyna_var_lookup(id)
while (vars) {
if (vars->id == id) {
- vars->val = Qtrue;
+ FL_SET(vars, DVAR_USED);
return Qtrue;
}
vars = vars->next;
@@ -5783,7 +5785,7 @@ dyna_init(node, pre)
if (!node || !post || pre == post) return node;
for (var = 0; post != pre && post->id; post = post->next) {
- if (RTEST(post->val)) {
+ if (FL_TEST(post, DVAR_USED)) {
var = NEW_DASGN_CURR(post->id, var);
}
}