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:
parent
bc4310718b
commit
75bf28bb42
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue