From dca0d299596c53ca38db3b06f412f02c6f0a5341 Mon Sep 17 00:00:00 2001 From: why Date: Thu, 31 Aug 2006 03:52:48 +0000 Subject: * eval.c (ruby_init): rename top_cref to ruby_top_cref and export, along with ruby_cref, for use by the sandbox. [ruby-core:08762] * node.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ eval.c | 10 +++++----- node.h | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77d5b32da..6148ec3d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Aug 31 12:46:55 2006 why the lucky stiff + + * eval.c (ruby_init): rename top_cref to ruby_top_cref and export, + along with ruby_cref, for use by the sandbox. [ruby-core:08762] + + * node.h: ditto. + Tue Aug 29 19:10:10 2006 Nobuyoshi Nakada * hash.c (rb_hash_s_create): fixed memory leak, based on the patch diff --git a/eval.c b/eval.c index afb528d59..506cf488c 100644 --- a/eval.c +++ b/eval.c @@ -1061,8 +1061,8 @@ static VALUE ruby_wrapper; /* security wrapper */ #define POP_CLASS() ruby_class = _class; \ } while (0) -static NODE *ruby_cref = 0; -static NODE *top_cref; +NODE *ruby_cref = 0; +NODE *ruby_top_cref; #define PUSH_CREF(c) ruby_cref = NEW_NODE(NODE_CREF,(c),0,ruby_cref) #define POP_CREF() ruby_cref = ruby_cref->nd_next @@ -1391,8 +1391,8 @@ ruby_init() rb_call_inits(); ruby_class = rb_cObject; ruby_frame->self = ruby_top_self; - top_cref = rb_node_newnode(NODE_CREF,rb_cObject,0,0); - ruby_cref = top_cref; + ruby_top_cref = rb_node_newnode(NODE_CREF,rb_cObject,0,0); + ruby_cref = ruby_top_cref; rb_define_global_const("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); #ifdef __MACOS__ _macruby_init(); @@ -6797,7 +6797,7 @@ rb_load(fname, wrap) ruby_errinfo = Qnil; /* ensure */ PUSH_VARS(); PUSH_CLASS(ruby_wrapper); - ruby_cref = top_cref; + ruby_cref = ruby_top_cref; if (!wrap) { rb_secure(4); /* should alter global state */ ruby_class = rb_cObject; diff --git a/node.h b/node.h index 39d02ae9d..dd73e8199 100644 --- a/node.h +++ b/node.h @@ -151,6 +151,9 @@ typedef struct RNode { } u3; } NODE; +extern NODE *ruby_cref; +extern NODE *ruby_top_cref; + #define RNODE(obj) (R_CAST(RNode)(obj)) #define nd_type(n) ((int)(((RNODE(n))->flags>>FL_USHIFT)&0xff)) -- cgit