1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vm_insnhelper.c: suppress a warning

* vm_insnhelper.c (vm_setivar): cast to long both side of a
  conditional expression to suppress a sign-compare warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-26 06:24:18 +00:00
parent 46b39cb0ba
commit 288f6e1b89

View file

@ -765,7 +765,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr)
if (LIKELY( if (LIKELY(
(!is_attr && ic->ic_serial == RCLASS_SERIAL(klass)) || (!is_attr && ic->ic_serial == RCLASS_SERIAL(klass)) ||
(is_attr && ci->aux.index > 0))) { (is_attr && ci->aux.index > 0))) {
long index = !is_attr ? (long)ic->ic_value.index : ci->aux.index-1; long index = !is_attr ? (long)ic->ic_value.index : (long)ci->aux.index-1;
long len = ROBJECT_NUMIV(obj); long len = ROBJECT_NUMIV(obj);
VALUE *ptr = ROBJECT_IVPTR(obj); VALUE *ptr = ROBJECT_IVPTR(obj);