1
0
Fork 0
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/branches/ruby_1_6@2497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-05-28 03:20:04 +00:00
parent ce184d5e68
commit 2b08467fb7
4 changed files with 30 additions and 4 deletions

View file

@ -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 14:52:32 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ruby.c (proc_options): -v should not print version if

12
eval.c
View file

@ -816,6 +816,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() { \
volatile int _vmode = scope_vmode; \
struct SCOPE * volatile _old; \
@ -2616,6 +2617,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;
@ -2909,6 +2911,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) {
@ -3259,6 +3269,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;
@ -4445,6 +4456,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
View file

@ -266,8 +266,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)

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.6.7"
#define RUBY_RELEASE_DATE "2002-05-23"
#define RUBY_RELEASE_DATE "2002-05-28"
#define RUBY_VERSION_CODE 167
#define RUBY_RELEASE_CODE 20020523
#define RUBY_RELEASE_CODE 20020528