diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-08 04:27:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-08 04:27:41 +0000 |
commit | e12090b9b23d54f41175f7fb3528419048f8c2bb (patch) | |
tree | 5de815ce5b888e81368dffce76ac297c852dbc9e /compile.c | |
parent | 31088109b728d2cd93051c2114ffef880b4fa8bb (diff) | |
download | ruby-e12090b9b23d54f41175f7fb3528419048f8c2bb.tar.gz |
* compile.c (defined_expr): test arguments of NODE_CALL and so
on as well as NODE_ATTRASGN. [ruby-core:10886]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -2031,8 +2031,9 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, LABEL *lfinish, VALUE needstr) { char *estr = 0; + enum node_type type; - switch (nd_type(node)) { + switch (type = nd_type(node)) { /* easy literals */ case NODE_NIL: @@ -2146,15 +2147,17 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret, LABEL *lfalse = NULL; int self = Qtrue; - switch (nd_type(node)) { + switch (type) { case NODE_ATTRASGN: - lfalse = NEW_LABEL(nd_line(node)); - defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse); if (node->nd_recv == (NODE *)1) break; case NODE_CALL: self = Qfalse; break; } + if (node->nd_args) { + lfalse = NEW_LABEL(nd_line(node)); + defined_expr(iseq, ret, node->nd_args, lfinish, Qfalse); + } if (!self) { LABEL *lcont = NEW_LABEL(nd_line(node)); |