1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,

should be wrapped by PUSH_TAG/POP_TAG().  [ruby-dev:24627]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-10-29 01:06:37 +00:00
parent 80e9b8f295
commit b0dee8f90d
5 changed files with 17 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Fri Oct 29 10:00:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,
should be wrapped by PUSH_TAG/POP_TAG(). [ruby-dev:24627]
Wed Oct 27 09:17:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (str_gsub): use a string object for exception safeness.

2
eval.c
View file

@ -1430,9 +1430,9 @@ ruby_cleanup(ex)
POP_ITER();
ruby_errinfo = err;
ex = error_handle(ex);
ruby_finalize_1();
POP_TAG();
ruby_finalize_1();
if (err && rb_obj_is_kind_of(err, rb_eSystemExit)) {
VALUE st = rb_iv_get(err, "status");
return NUM2INT(st);

View file

@ -640,7 +640,13 @@ zstream_detach_input(z)
{
VALUE dst;
dst = NIL_P(z->input) ? rb_str_new(0, 0) : z->input;
if (NIL_P(z->input)) {
dst = rb_str_new(0, 0);
}
else {
dst = z->input;
RBASIC(dst)->klass = rb_cString;
}
z->input = Qnil;
RBASIC(dst)->klass = rb_cString;
return dst;

6
io.c
View file

@ -4131,8 +4131,8 @@ rb_io_s_for_fd(argc, argv, klass)
static int binmode = 0;
static VALUE
argf_forward(argv)
VALUE *argv;
argf_forward(
VALUE *argv)
{
return rb_funcall3(current_file, ruby_frame->last_func, ruby_frame->argc, argv);
}
@ -5224,7 +5224,7 @@ argf_read(argc, argv)
return str;
}
if (TYPE(current_file) != T_FILE) {
tmp = argf_forward();
tmp = argf_forward(argv);
}
else {
tmp = io_read(argc, argv, current_file);

View file

@ -1023,7 +1023,7 @@ class CGI
content_length -= c.size
end
buf = buf.sub(/\A((?:.|\n)*?)(?:#{EOL})?#{boundary}(#{EOL}|--)/n) do
buf = buf.sub(/\A((?:.|\n)*?)(?:#{EOL})?#{boundary}(#{EOL}|#{LF}|--)/n) do
body.print $1
if "--" == $2
content_length = -1