ruby-changes:44651
From: mrkn <ko1@a...>
Date: Sat, 12 Nov 2016 01:18:18 +0900 (JST)
Subject: [ruby-changes:44651] mrkn:r56724 (trunk): rational.c: add argument type check assertions in f_muldiv
mrkn 2016-11-12 01:18:13 +0900 (Sat, 12 Nov 2016) New Revision: 56724 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56724 Log: rational.c: add argument type check assertions in f_muldiv * rational.c (f_muldiv): add assertions to check argument types Modified files: trunk/rational.c Index: rational.c =================================================================== --- rational.c (revision 56723) +++ rational.c (revision 56724) @@ -809,6 +809,12 @@ f_muldiv(VALUE self, VALUE anum, VALUE a https://github.com/ruby/ruby/blob/trunk/rational.c#L809 { 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/