summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-13 00:40:52 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-13 00:40:52 +0000
commit7f6691ae77546b42a4b182ca5ddbf5e2312c6a7b (patch)
tree7f1b465783cd3a61738aecc85c56e9fee834b106 /vm_insnhelper.c
parent803dcea481ea20fc7dfc690e73ccb23646a5c4ab (diff)
suppress integer overflow warnings
* random.c: annotate rb_hash_start with NO_SANITIZE (seed.key.hash + h overflows and that seems intentional) * bignum.c: avoid (size_t)-- * cont.c: ditto * util.c: ditto * vm_insnhelper.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 7fb18714dd..ef4c938fc5 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3211,7 +3211,7 @@ vm_opt_newarray_max(rb_num_t num, const VALUE *ptr)
else {
struct cmp_opt_data cmp_opt = { 0, 0 };
VALUE result = *ptr;
- rb_num_t i = num - 1;
+ rb_snum_t i = num - 1;
while (i-- > 0) {
const VALUE v = *++ptr;
if (OPTIMIZED_CMP(v, result, cmp_opt) > 0) {
@@ -3237,7 +3237,7 @@ vm_opt_newarray_min(rb_num_t num, const VALUE *ptr)
else {
struct cmp_opt_data cmp_opt = { 0, 0 };
VALUE result = *ptr;
- rb_num_t i = num - 1;
+ rb_snum_t i = num - 1;
while (i-- > 0) {
const VALUE v = *++ptr;
if (OPTIMIZED_CMP(v, result, cmp_opt) < 0) {