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:
Yukihiro "Matz" Matsumoto
2022-02-08 12:44:50 +09:00
parent 6f5e74f576
commit 4c13188ea6
+6
View File
@@ -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);