mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: generate OP_HASH in gen_hash() if limit exceeds.
That means when `limit` is `0` it should always generate a hash.
This commit is contained in:
@@ -1643,6 +1643,12 @@ gen_hash(codegen_scope *s, node *tree, int val, int limit)
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
if (val && len > limit) {
|
||||
pop_n(len*2);
|
||||
genop_2(s, OP_HASH, cursp(), len);
|
||||
push();
|
||||
return -1;
|
||||
}
|
||||
if (update) {
|
||||
if (val && len > 0) {
|
||||
pop_n(len*2+1);
|
||||
|
||||
Reference in New Issue
Block a user