mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Cast properly for shift operand
`(int) << RHASH_LEV_SHIFT` can be negative integer.
This commit is contained in:
parent
daa04c5562
commit
dff69bb462
1 changed files with 1 additions and 1 deletions
2
hash.c
2
hash.c
|
|
@ -1434,7 +1434,7 @@ hash_iter_lev_inc(VALUE hash)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lev += 1;
|
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) {
|
if (lev == RHASH_LEV_MAX) {
|
||||||
iter_lev_in_ivar_set(hash, lev);
|
iter_lev_in_ivar_set(hash, lev);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue