diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-25 14:18:13 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-25 14:18:13 +0000 |
commit | 4f180097d31c3532455366a23fe5830b32f5eb0a (patch) | |
tree | 3e0ca10373141c43a143ee206c5d879c1ba1d737 /ext/dl/dl.c | |
parent | df9199d468ffd0b0dfc669dbbb8923301a4b1d07 (diff) | |
download | ruby-4f180097d31c3532455366a23fe5830b32f5eb0a.tar.gz |
use NUM2SIZET instead of NUM2INT
* ext/dl/dl.c (rb_dl_realloc): use NUM2SIZET instead of NUM2INT.
* ext/fiddle/fiddle.c (rb_fiddle_realloc): ditto.
* ext/dl/dl.c (rb_dl_malloc): use NUM2SIZET instead of NUM2INT.
Coverity Scan found this bug.
* ext/fiddle/fiddle.c (rb_fiddle_malloc): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/dl.c')
-rw-r--r-- | ext/dl/dl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c index 23f5d7fe6e..7ad77dd6b2 100644 --- a/ext/dl/dl.c +++ b/ext/dl/dl.c @@ -81,7 +81,7 @@ rb_dl_malloc(VALUE self, VALUE size) { void *ptr; - ptr = (void*)ruby_xmalloc(NUM2INT(size)); + ptr = (void*)ruby_xmalloc(NUM2SIZET(size)); return PTR2NUM(ptr); } @@ -97,7 +97,7 @@ rb_dl_realloc(VALUE self, VALUE addr, VALUE size) { void *ptr = NUM2PTR(addr); - ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size)); + ptr = (void*)ruby_xrealloc(ptr, NUM2SIZET(size)); return PTR2NUM(ptr); } |