diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-17 05:26:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-17 05:26:33 +0000 |
commit | f95348378770d8d0967690ae0de492a1444187a3 (patch) | |
tree | 632bb5d38fe918b9e833aa2a848887ad35803a33 | |
parent | 074836aacac05113acf7fd96d4a9cdb144b57368 (diff) | |
download | ruby-f95348378770d8d0967690ae0de492a1444187a3.tar.gz |
* ext/dl/cfunc.c (rb_dlcfunc_inspect): get rid of overflow.
* ext/dl/closure.c (dlc_callback, rb_dlclosure_init): ditto.
* ext/dl/cptr.c (rb_dlptr_s_malloc): ditto.
* ext/dl/method.c (rb_dlfunction_initialize): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | ext/dl/cfunc.c | 2 | ||||
-rw-r--r-- | ext/dl/closure.c | 4 | ||||
-rw-r--r-- | ext/dl/cptr.c | 2 | ||||
-rw-r--r-- | ext/dl/method.c | 2 |
5 files changed, 15 insertions, 5 deletions
@@ -1,3 +1,13 @@ +Wed Feb 17 14:26:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/dl/cfunc.c (rb_dlcfunc_inspect): get rid of overflow. + + * ext/dl/closure.c (dlc_callback, rb_dlclosure_init): ditto. + + * ext/dl/cptr.c (rb_dlptr_s_malloc): ditto. + + * ext/dl/method.c (rb_dlfunction_initialize): ditto. + Wed Feb 17 01:16:12 2010 Yusuke Endoh <mame@tsg.ne.jp> * hash.c (hash_update): always raise an exception when adding a new diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c index aa744d26ec..21afcc5677 100644 --- a/ext/dl/cfunc.c +++ b/ext/dl/cfunc.c @@ -284,7 +284,7 @@ rb_dlcfunc_inspect(VALUE self) { VALUE val; char *str; - int str_size; + size_t str_size; struct cfunc_data *cfunc; TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc); diff --git a/ext/dl/closure.c b/ext/dl/closure.c index da5ade1d87..a2e0b05bb4 100644 --- a/ext/dl/closure.c +++ b/ext/dl/closure.c @@ -57,7 +57,7 @@ dlc_callback(ffi_cif *cif, void *resp, void **args, void *ctx) VALUE self = (VALUE)ctx; VALUE rbargs = rb_iv_get(self, "@args"); VALUE ctype = rb_iv_get(self, "@ctype"); - int argc = RARRAY_LEN(rbargs); + int argc = RARRAY_LENINT(rbargs); VALUE *params = xcalloc(argc, sizeof(VALUE *)); VALUE ret; int i, dl_type; @@ -165,7 +165,7 @@ rb_dlclosure_init(int rbargc, VALUE argv[], VALUE self) if (2 == rb_scan_args(rbargc, argv, "21", &ret, &args, &abi)) abi = INT2NUM(FFI_DEFAULT_ABI); - argc = RARRAY_LEN(args); + argc = RARRAY_LENINT(args); TypedData_Get_Struct(self, dl_closure, &dlclosure_data_type, cl); diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c index 2598641371..75848f8358 100644 --- a/ext/dl/cptr.c +++ b/ext/dl/cptr.c @@ -186,7 +186,7 @@ static VALUE rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass) { VALUE size, sym, obj; - int s; + long s; freefunc_t f; switch (rb_scan_args(argc, argv, "11", &size, &sym)) { diff --git a/ext/dl/method.c b/ext/dl/method.c index 8462292d98..1bd0fa8c3e 100644 --- a/ext/dl/method.c +++ b/ext/dl/method.c @@ -91,7 +91,7 @@ rb_dlfunction_initialize(int argc, VALUE argv[], VALUE self) result = ffi_prep_cif ( cif, NUM2INT(abi), - RARRAY_LEN(args), + RARRAY_LENINT(args), DL2FFI_TYPE(NUM2INT(ret_type)), arg_types); |