mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long to
cast to int. [ruby-dev:38508] * struct.c, vm_eval.c, vm_insnhelper.c: use RARRAY_LENINT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c573aaf73f
commit
060f433f48
7 changed files with 45 additions and 21 deletions
6
struct.c
6
struct.c
|
@ -378,7 +378,7 @@ rb_struct_initialize_m(int argc, VALUE *argv, VALUE self)
|
|||
VALUE
|
||||
rb_struct_initialize(VALUE self, VALUE values)
|
||||
{
|
||||
return rb_struct_initialize_m(RARRAY_LEN(values), RARRAY_PTR(values), self);
|
||||
return rb_struct_initialize_m(RARRAY_LENINT(values), RARRAY_PTR(values), self);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
@ -414,10 +414,10 @@ VALUE
|
|||
rb_struct_new(VALUE klass, ...)
|
||||
{
|
||||
VALUE tmpargs[N_REF_FUNC], *mem = tmpargs;
|
||||
long size, i;
|
||||
int size, i;
|
||||
va_list args;
|
||||
|
||||
size = num_members(klass);
|
||||
size = rb_long2int(num_members(klass));
|
||||
if (size > numberof(tmpargs)) {
|
||||
tmpargs[0] = rb_ary_tmp_new(size);
|
||||
mem = RARRAY_PTR(tmpargs[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue