diff --git a/hash.c b/hash.c index 4477ab5853..62383a6c92 100644 --- a/hash.c +++ b/hash.c @@ -1434,7 +1434,7 @@ hash_iter_lev_inc(VALUE hash) } else { lev += 1; - RBASIC(hash)->flags = ((RBASIC(hash)->flags & ~RHASH_LEV_MASK) | (lev << RHASH_LEV_SHIFT)); + RBASIC(hash)->flags = ((RBASIC(hash)->flags & ~RHASH_LEV_MASK) | ((VALUE)lev << RHASH_LEV_SHIFT)); if (lev == RHASH_LEV_MAX) { iter_lev_in_ivar_set(hash, lev); }