mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (scope_node): trick to keep the node has a scope.
* eval.c (rb_eval): NODE_EVSTR: write back local_tbl to the node. * eval.c (rb_eval): NODE_SCOPE: hold the scope node in ruby_scope. * eval.c (module_setup): ditto. * eval.c (rb_call0): ditto. * node.h (NEW_DASGN, NEW_DASGN_CURR): remove surplus semicolons. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1fe8b37425
commit
ff3d6d201d
4 changed files with 30 additions and 4 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
Tue May 28 12:13:37 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* eval.c (scope_node): trick to keep the node has a scope.
|
||||
|
||||
* eval.c (rb_eval): NODE_EVSTR: write back local_tbl to the node.
|
||||
|
||||
* eval.c (rb_eval): NODE_SCOPE: hold the scope node in ruby_scope.
|
||||
|
||||
* eval.c (module_setup): ditto.
|
||||
|
||||
* eval.c (rb_call0): ditto.
|
||||
|
||||
* node.h (NEW_DASGN, NEW_DASGN_CURR): remove surplus semicolons.
|
||||
|
||||
Thu May 23 16:39:21 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* ruby.c (proc_options): option parsing problem.
|
||||
|
|
12
eval.c
12
eval.c
|
@ -840,6 +840,7 @@ static NODE *top_cref;
|
|||
#define PUSH_CREF(c) ruby_cref = rb_node_newnode(NODE_CREF,(c),0,ruby_cref)
|
||||
#define POP_CREF() ruby_cref = ruby_cref->nd_next
|
||||
|
||||
#define scope_node super.klass
|
||||
#define PUSH_SCOPE() do { \
|
||||
volatile int _vmode = scope_vmode; \
|
||||
struct SCOPE * volatile _old; \
|
||||
|
@ -2783,6 +2784,7 @@ rb_eval(self, n)
|
|||
ruby_cref = (NODE*)node->nd_rval;
|
||||
ruby_frame->cbase = node->nd_rval;
|
||||
}
|
||||
ruby_scope->scope_node = (VALUE)node;
|
||||
if (node->nd_tbl) {
|
||||
VALUE *vars = ALLOCA_N(VALUE, node->nd_tbl[0]+1);
|
||||
*vars++ = (VALUE)node;
|
||||
|
@ -3076,6 +3078,14 @@ rb_eval(self, n)
|
|||
list->nd_head = compile(list->nd_head->nd_lit,
|
||||
ruby_sourcefile,
|
||||
ruby_sourceline);
|
||||
if (ruby_scope->local_tbl) {
|
||||
NODE *body = (NODE *)ruby_scope->scope_node;
|
||||
if (body && body->nd_tbl != ruby_scope->local_tbl) {
|
||||
if (body->nd_tbl) free(body->nd_tbl);
|
||||
ruby_scope->local_vars[-1] =
|
||||
(VALUE)(body->nd_tbl = ruby_scope->local_tbl);
|
||||
}
|
||||
}
|
||||
ruby_eval_tree = 0;
|
||||
ruby_in_eval--;
|
||||
if (ruby_nerrs > 0) {
|
||||
|
@ -3413,6 +3423,7 @@ module_setup(module, n)
|
|||
PUSH_SCOPE();
|
||||
PUSH_VARS();
|
||||
|
||||
ruby_scope->scope_node = (VALUE)node;
|
||||
if (node->nd_tbl) {
|
||||
VALUE *vars = TMP_ALLOC(node->nd_tbl[0]+1);
|
||||
*vars++ = (VALUE)node;
|
||||
|
@ -4552,6 +4563,7 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper)
|
|||
ruby_cref = (NODE*)body->nd_rval;
|
||||
ruby_frame->cbase = body->nd_rval;
|
||||
}
|
||||
ruby_scope->scope_node = (VALUE)body;
|
||||
if (body->nd_tbl) {
|
||||
local_vars = TMP_ALLOC(body->nd_tbl[0]+1);
|
||||
*local_vars++ = (VALUE)body;
|
||||
|
|
4
node.h
4
node.h
|
@ -267,8 +267,8 @@ typedef struct RNode {
|
|||
#define NEW_MASGN(l,r) rb_node_newnode(NODE_MASGN,l,0,r)
|
||||
#define NEW_GASGN(v,val) rb_node_newnode(NODE_GASGN,v,val,rb_global_entry(v))
|
||||
#define NEW_LASGN(v,val) rb_node_newnode(NODE_LASGN,v,val,local_cnt(v))
|
||||
#define NEW_DASGN(v,val) rb_node_newnode(NODE_DASGN,v,val,0);
|
||||
#define NEW_DASGN_CURR(v,val) rb_node_newnode(NODE_DASGN_CURR,v,val,0);
|
||||
#define NEW_DASGN(v,val) rb_node_newnode(NODE_DASGN,v,val,0)
|
||||
#define NEW_DASGN_CURR(v,val) rb_node_newnode(NODE_DASGN_CURR,v,val,0)
|
||||
#define NEW_IASGN(v,val) rb_node_newnode(NODE_IASGN,v,val,0)
|
||||
#define NEW_CDECL(v,val) rb_node_newnode(NODE_CDECL,v,val,0)
|
||||
#define NEW_CVASGN(v,val) rb_node_newnode(NODE_CVASGN,v,val,0)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#define RUBY_VERSION "1.7.2"
|
||||
#define RUBY_RELEASE_DATE "2002-05-23"
|
||||
#define RUBY_RELEASE_DATE "2002-05-28"
|
||||
#define RUBY_VERSION_CODE 172
|
||||
#define RUBY_RELEASE_CODE 20020523
|
||||
#define RUBY_RELEASE_CODE 20020528
|
||||
|
|
Loading…
Reference in a new issue