diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-08 14:20:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-06-08 14:20:58 +0000 |
commit | 46e8ae110469cc8da8d1aad01dec7cd0a83eaae1 (patch) | |
tree | b226bf0b6becd50f95c027133059e7bf07376bdb /eval.c | |
parent | 1b6b6ef2d645e99b66e775c9a5ee97e201e141a1 (diff) | |
download | ruby-46e8ae110469cc8da8d1aad01dec7cd0a83eaae1.tar.gz |
* gc.c (Init_stack): avoid __builtin_frame_address(2) to retrieve
stack bottom line.
* st.c (numhash): should shuffle bits by dividing by prime number.
* eval.c (rb_eval): multiple assignment behavior fixed, which
results "*a = nil" makes "a == []" now.
* eval.c (rb_f_require): should set SCOPE_PUBLIC before calling
dln_load().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 29 |
1 files changed, 19 insertions, 10 deletions
@@ -2344,6 +2344,7 @@ rb_eval(self, n) break; case NODE_RESTARGS: + case NODE_RESTARY: result = rb_eval(self, node->nd_head); if (TYPE(result) != T_ARRAY) { result = rb_Array(result); @@ -2355,7 +2356,10 @@ rb_eval(self, n) if (TYPE(result) != T_ARRAY) { result = rb_Array(result); } - if (RARRAY(result)->len == 1) { + if (RARRAY(result)->len == 0) { + result = Qnil; + } + else if (RARRAY(result)->len == 1) { result = RARRAY(result)->ptr[0]; } break; @@ -3724,7 +3728,7 @@ massign(self, node, val, check) NODE *list; int i = 0, len; - if (val == Qundef) { + if (val == Qundef || val == Qnil) { val = rb_ary_new2(0); } else if (TYPE(val) != T_ARRAY) { @@ -5425,17 +5429,22 @@ rb_f_require(obj, fname) load_dyna: rb_provide(feature); + { + int volatile old_vmode = scope_vmode; - PUSH_TAG(PROT_NONE); - if ((state = EXEC_TAG()) == 0) { - void *handle; + PUSH_TAG(PROT_NONE); + if ((state = EXEC_TAG()) == 0) { + void *handle; - load = rb_str_new2(file); - file = RSTRING(load)->ptr; - handle = dln_load(file); - rb_ary_push(ruby_dln_librefs, INT2NUM((long)handle)); + SCOPE_SET(SCOPE_PUBLIC); + load = rb_str_new2(file); + file = RSTRING(load)->ptr; + handle = dln_load(file); + rb_ary_push(ruby_dln_librefs, INT2NUM((long)handle)); + } + POP_TAG(); + SCOPE_SET(old_vmode); } - POP_TAG(); if (state) JUMP_TAG(state); return Qtrue; |