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

rational.c: add argument type check assertions in f_muldiv

* rational.c (f_muldiv): add assertions to check argument types

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mrkn 2016-11-11 16:18:13 +00:00
parent bc4310718b
commit 75bf28bb42

View file

@ -809,6 +809,12 @@ f_muldiv(VALUE self, VALUE anum, VALUE aden, VALUE bnum, VALUE bden, int k)
{
VALUE num, den;
assert(RB_TYPE_P(self, T_RATIONAL));
assert(RB_INTEGER_TYPE_P(anum));
assert(RB_INTEGER_TYPE_P(aden));
assert(RB_INTEGER_TYPE_P(bnum));
assert(RB_INTEGER_TYPE_P(bden));
if (k == '/') {
VALUE t;