From d167cfd196c410cbab11e1c3b8cce14297e4a085 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 7 Oct 2009 07:06:32 +0000 Subject: * include/ruby/ruby.h (rb_long2int): evalates the argument only once. * struct.c (rb_struct_alloc): check array length overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index f3b8279213..fe3885f7a6 100644 --- a/struct.c +++ b/struct.c @@ -415,7 +415,7 @@ struct_alloc(VALUE klass) VALUE rb_struct_alloc(VALUE klass, VALUE values) { - return rb_class_new_instance(RARRAY_LEN(values), RARRAY_PTR(values), klass); + return rb_class_new_instance(RARRAY_LENINT(values), RARRAY_PTR(values), klass); } VALUE -- cgit v1.2.3