summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--io.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bdf98804d..892ba8f5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * io.c (io_read): should freeze buffer before thread context
+ switch. [ruby-dev:24442]
+
* pack.c (pack_unpack): string conversion should at the top of the
method. [ruby-dev:24439]
diff --git a/io.c b/io.c
index f188f74c1..52e71f3df 100644
--- a/io.c
+++ b/io.c
@@ -1197,8 +1197,8 @@ io_read(argc, argv, io)
}
if (len == 0) return str;
- READ_CHECK(fptr->f);
FL_SET(str, FL_FREEZE);
+ READ_CHECK(fptr->f);
n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
FL_UNSET(str, FL_FREEZE);
if (n == 0) {