mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* variable.c (rb_const_get): no recursion to show full class path
for modules. * eval.c (rb_set_safe_level): should set safe level in curr_thread as well. * eval.c (safe_setter): ditto. * object.c (rb_obj_is_instance_of): nil belongs to false, not true. * time.c (make_time_t): proper (I hope) daylight saving time handling for both US and Europe. I HATE SUMMER TIME! * eval.c (rb_thread_wait_for): non blocked signal interrupt should stop the interval. * class.c (rb_mod_clone): should copy method bodies too. * bignum.c (bigdivrem): should trim trailing zero bdigits of remainder, even if dd == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2c29a1c0e9
commit
0c176f00c1
14 changed files with 264 additions and 152 deletions
11
variable.c
11
variable.c
|
@ -1064,10 +1064,11 @@ rb_const_get(klass, id)
|
|||
VALUE klass;
|
||||
ID id;
|
||||
{
|
||||
VALUE value;
|
||||
VALUE tmp;
|
||||
VALUE value, tmp;
|
||||
int mod_retry = 0;
|
||||
|
||||
tmp = klass;
|
||||
retry:
|
||||
while (tmp) {
|
||||
if (RCLASS(tmp)->iv_tbl && st_lookup(RCLASS(tmp)->iv_tbl,id,&value)) {
|
||||
return value;
|
||||
|
@ -1075,8 +1076,10 @@ rb_const_get(klass, id)
|
|||
if (tmp == rb_cObject && top_const_get(id, &value)) return value;
|
||||
tmp = RCLASS(tmp)->super;
|
||||
}
|
||||
if (BUILTIN_TYPE(klass) == T_MODULE) {
|
||||
return rb_const_get(rb_cObject, id);
|
||||
if (!mod_retry && BUILTIN_TYPE(klass) == T_MODULE) {
|
||||
mod_retry = 1;
|
||||
tmp = rb_cObject;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
/* Uninitialized constant */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue