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

* time.c (time_timespec): use rb_check_funcall.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-28 09:04:51 +00:00
parent 603363369b
commit f510d9f3c4
2 changed files with 7 additions and 6 deletions

View file

@ -1,3 +1,7 @@
Wed Apr 28 18:04:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (time_timespec): use rb_check_funcall.
Wed Apr 28 17:14:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/extconf.rb: CMSG_ macros are broken on 64bit darwin,

9
time.c
View file

@ -2296,11 +2296,9 @@ time_timespec(VALUE num, int interval)
break;
default:
if (rb_respond_to(num, id_divmod)) {
ary = rb_check_array_type(rb_funcall(num, id_divmod, 1, INT2FIX(1)));
if (NIL_P(ary)) {
goto typeerror;
}
i = INT2FIX(1);
ary = rb_check_funcall(num, id_divmod, 1, &i);
if (ary != Qundef && !NIL_P(ary = rb_check_array_type(ary))) {
i = rb_ary_entry(ary, 0);
f = rb_ary_entry(ary, 1);
t.tv_sec = NUM2TIMET(i);
@ -2310,7 +2308,6 @@ time_timespec(VALUE num, int interval)
t.tv_nsec = NUM2LONG(f);
}
else {
typeerror:
rb_raise(rb_eTypeError, "can't convert %s into %s",
rb_obj_classname(num), tstr);
}