diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-12 14:28:58 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-12 14:28:58 +0000 |
| commit | 377f3d663a803f532df5a5246152184e2fb345d2 (patch) | |
| tree | 79dfb7db1495dd93873cc173d832d15546f091d6 | |
| parent | 3f5ea9690c8a1a9c8fb16f6e31c13ef10bede474 (diff) | |
| download | ruby-377f3d663a803f532df5a5246152184e2fb345d2.tar.gz ruby-377f3d663a803f532df5a5246152184e2fb345d2.tar.xz ruby-377f3d663a803f532df5a5246152184e2fb345d2.zip | |
* gc.c (vm_xmalloc, vm_xrealloc): comparisons had no meanings on
platforms where size_t is unsigned.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | gc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -608,7 +608,7 @@ vm_xmalloc(rb_objspace_t *objspace, size_t size) { void *mem; - if (size < 0) { + if ((ssize_t)size < 0) { negative_size_allocation_error("negative allocation size (or too big)"); } if (size == 0) size = 1; @@ -647,7 +647,7 @@ vm_xrealloc(rb_objspace_t *objspace, void *ptr, size_t size) { void *mem; - if (size < 0) { + if ((ssize_t)size < 0) { negative_size_allocation_error("negative re-allocation size"); } if (!ptr) return ruby_xmalloc(size); |
