mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 04:55:21 +02:00
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b524523217
commit
ab3d450a54
3 changed files with 27 additions and 4 deletions
13
eval.c
13
eval.c
|
@ -8408,16 +8408,25 @@ proc_clone(self)
|
|||
* MISSING: documentation
|
||||
*/
|
||||
|
||||
#define PROC_TSHIFT (FL_USHIFT+1)
|
||||
#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3)
|
||||
#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT)
|
||||
|
||||
static int proc_get_safe_level(VALUE);
|
||||
|
||||
static VALUE
|
||||
proc_dup(self)
|
||||
VALUE self;
|
||||
{
|
||||
struct BLOCK *orig, *data;
|
||||
VALUE bind;
|
||||
int safe = proc_get_safe_level(self);
|
||||
|
||||
Data_Get_Struct(self, struct BLOCK, orig);
|
||||
bind = Data_Make_Struct(rb_obj_class(self),struct BLOCK,blk_mark,blk_free,data);
|
||||
blk_dup(data, orig);
|
||||
if (safe > PROC_TMAX) safe = PROC_TMAX;
|
||||
FL_SET(bind, (safe << PROC_TSHIFT) & PROC_TMASK);
|
||||
|
||||
return bind;
|
||||
}
|
||||
|
@ -8521,10 +8530,6 @@ bind_eval(argc, argv, bindval)
|
|||
return rb_f_eval(argc+1, args, Qnil /* self will be searched in eval */);
|
||||
}
|
||||
|
||||
#define PROC_TSHIFT (FL_USHIFT+1)
|
||||
#define PROC_TMASK (FL_USER1|FL_USER2|FL_USER3)
|
||||
#define PROC_TMAX (PROC_TMASK >> PROC_TSHIFT)
|
||||
|
||||
#define SAFE_LEVEL_MAX PROC_TMASK
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue