summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-06 09:44:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-06 09:44:22 +0000
commitbad7546f15573e06208651a39b9c41ff921c25a2 (patch)
tree08e46c18c451065e8bde952eb9765177edac3cc7 /eval.c
parent9e77e91a13a8ae1d8bb4bba8974da390fbadedc0 (diff)
* gc.c (define_final): eliminate rb_f_lambda() call.
* class.c (rb_scan_args): ditto. * signal.c (sig_trap): ditto. * hash.c (rb_hash_initialize): ditto. * variable.c (rb_f_trace_var): ditto. * ext/dl/dl.c (rb_dl_callback): ditto. * ext/win32ole/win32ole.c (ev_on_event): ditto. * eval.c (ruby_cleanup): $SAFE is turned off in the finalization. Each END proc should preserve its own $SAFE level. [ruby-core:01119] * marshal.c (marshal_load): remove unused variable "hash". [ruby-core:01120] * hash.c (env_str_new): freeze strings from ENV. [ruby-talk:72860] * array.c (rb_ary_first): optional argument to retrieve first n elements. * array.c (rb_ary_last): optional argument to retrieve last n elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/eval.c b/eval.c
index 7a8d1d5..13c9dcb 100644
--- a/eval.c
+++ b/eval.c
@@ -96,7 +96,6 @@ char *strrchr _((const char*,const char));
VALUE rb_cBlock, rb_cProc;
static VALUE rb_cBinding;
static VALUE block_invoke _((VALUE,VALUE,VALUE,VALUE));
-static VALUE block_new _((void));
static VALUE rb_f_binding _((VALUE));
static void rb_f_END _((void));
static VALUE rb_f_block_given_p _((void));
@@ -3223,7 +3222,7 @@ rb_eval(self, n)
if (ruby_scope->local_vars == 0)
rb_bug("unexpected block argument");
if (rb_block_given_p()) {
- result = block_new();
+ result = rb_block_new();
ruby_scope->local_vars[node->nd_cnt] = result;
}
else {
@@ -6377,7 +6376,7 @@ rb_f_END()
{
PUSH_FRAME();
ruby_frame->argc = 0;
- rb_set_end_proc(call_end_proc, rb_f_lambda());
+ rb_set_end_proc(call_end_proc, rb_block_new());
POP_FRAME();
}
@@ -6880,8 +6879,8 @@ block_s_new(argc, argv, klass)
return block;
}
-static VALUE
-block_new()
+VALUE
+rb_block_new()
{
if (ruby_block->flags & BLOCK_PROC) {
return block_alloc(rb_cProc, Qtrue);
@@ -7504,7 +7503,7 @@ mblock(method)
/* emulate ruby's method call */
PUSH_ITER(ITER_CUR);
PUSH_FRAME();
- proc = rb_f_lambda();
+ proc = rb_block_new();
POP_FRAME();
POP_ITER();