From 4aaa5493f94965fb3bbf85628f59310ff1a7a8d4 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 4 Aug 2003 05:28:50 +0000 Subject: * eval.c (method_proc): should specify YIELD_FUNC_SVALUE. [ruby-dev:21107] * marshal.c (w_object): should not call w_extended for USRMARSHAL dump. [ruby-dev:21106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ eval.c | 3 +-- io.c | 8 ++++---- marshal.c | 3 ++- numeric.c | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08b60a6c97..62c57b64be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Aug 4 13:05:57 2003 Yukihiro Matsumoto + + * eval.c (method_proc): should specify YIELD_FUNC_SVALUE. + [ruby-dev:21107] + + * marshal.c (w_object): should not call w_extended for USRMARSHAL + dump. [ruby-dev:21106] + Mon Aug 4 10:42:00 2003 Nathaniel Talbott * lib/test/unit/ui/console/testrunner.rb: Flushed io in the diff --git a/eval.c b/eval.c index d7b78d9d13..35fed14138 100644 --- a/eval.c +++ b/eval.c @@ -7604,6 +7604,7 @@ method_proc(method) Data_Get_Struct(proc, struct BLOCK, bdata); bdata->body->nd_file = mdata->body->nd_file; nd_set_line(bdata->body, nd_line(mdata->body)); + bdata->body->nd_state = YIELD_FUNC_SVALUE; return proc; } @@ -8479,8 +8480,6 @@ rb_thread_schedule() int need_select = 0; int select_timeout = 0; - if (ruby_in_compile) abort(); - rb_thread_pending = 0; if (curr_thread == curr_thread->next && curr_thread->status == THREAD_RUNNABLE) diff --git a/io.c b/io.c index eadaae48e2..b6dfd05c90 100644 --- a/io.c +++ b/io.c @@ -478,7 +478,7 @@ rb_io_tell(io) GetOpenFile(io, fptr); pos = io_tell(fptr); - if (ferror(fptr->f)) rb_sys_fail(fptr->path); + if (pos < 0) rb_sys_fail(fptr->path); return OFFT2NUM(pos); } @@ -492,7 +492,7 @@ rb_io_seek(io, offset, whence) GetOpenFile(io, fptr); pos = io_seek(fptr, NUM2OFFT(offset), whence); - if (pos != 0) rb_sys_fail(fptr->path); + if (pos < 0) rb_sys_fail(fptr->path); clearerr(fptr->f); return INT2FIX(0); @@ -1221,9 +1221,9 @@ rb_io_each_byte(io) TRAP_END; if (c == EOF) { if (ferror(f)) { + clearerr(f); if (!rb_io_wait_readable(fileno(f))) rb_sys_fail(fptr->path); - clearerr(f); continue; } break; @@ -1254,9 +1254,9 @@ rb_io_getc(io) if (c == EOF) { if (ferror(f)) { + clearerr(f); if (!rb_io_wait_readable(fileno(f))) rb_sys_fail(fptr->path); - clearerr(f); goto retry; } return Qnil; diff --git a/marshal.c b/marshal.c index c5f68bd1e8..835783958d 100644 --- a/marshal.c +++ b/marshal.c @@ -484,7 +484,8 @@ w_object(obj, arg, limit) VALUE v; v = rb_funcall(obj, s_mdump, 0, 0); - w_class(TYPE_USRMARSHAL, obj, arg); + w_byte(TYPE_USRMARSHAL, arg); + w_unique(rb_class2name(CLASS_OF(obj)), arg); w_object(v, arg, limit); if (ivtbl) w_ivar(ivtbl, &c_arg); return; diff --git a/numeric.c b/numeric.c index 4ea6114e38..71e4539d07 100644 --- a/numeric.c +++ b/numeric.c @@ -289,7 +289,7 @@ static VALUE flo_to_s(flt) VALUE flt; { - char buf[25]; + char buf[32]; char *fmt = "%.15g"; double value = RFLOAT(flt)->value; double avalue, d1, d2; -- cgit v1.2.3