From e11f6de3c590f5c735fa370b7ad38d1c877d1491 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 7 Apr 2003 06:58:31 +0000 Subject: * ext/socket/socket.c (sock_s_unpack_sockaddr_in): remove struct size check. getnameinfo(3) can handle. [ruby-dev:19967] * io.c (io_read): do not call rb_sys_fail() when required data length is zero. (ruby-bugs-ja PR#420) * eval.c (umethod_proc): should raise TypeError, instead of returning error causing Proc. Following the principle of "fail early". [ruby-core:00927] * pack.c (pack_pack): small but serious typo. * eval.c (backtrace): skip internal allocator frame. (ruby-bugs-ja PR#416) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 90f91408ad..9b4420d7af 100644 --- a/eval.c +++ b/eval.c @@ -5087,6 +5087,9 @@ backtrace(lev) NODE *n; ary = rb_ary_new(); + if (frame->last_func == ID_ALLOCATOR) { + frame = frame->prev; + } if (lev < 0) { ruby_set_current_source(); if (frame->last_func) { @@ -7317,13 +7320,6 @@ bmcall(args, method) return method_call(RARRAY(a)->len, RARRAY(a)->ptr, method); } -static VALUE -umcall(args, method) - VALUE args, method; -{ - return method_call(0, 0, method); -} - VALUE rb_proc_new(func, val) VALUE (*func)(ANYARGS); /* VALUE yieldarg[, VALUE procarg] */ @@ -7343,7 +7339,8 @@ static VALUE umethod_proc(method) VALUE method; { - return rb_iterate((VALUE(*)_((VALUE)))mproc, method, umcall, method); + rb_raise(rb_eTypeError, "unbound method cannot be executed; bind first"); + return Qnil; /* not reached */ } static VALUE -- cgit v1.2.3