Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
codegen.c: no OP_HASHADD required when val is false.
  • Loading branch information
matz committed Jan 21, 2022
1 parent adb16fc commit b611c43
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mrbgems/mruby-compiler/core/codegen.c
Expand Up @@ -1644,14 +1644,13 @@ gen_hash(codegen_scope *s, node *tree, int val, int limit)
}
}
if (update) {
if (len > 0) {
if (val && len > 0) {
pop_n(len*2+1);
genop_2(s, OP_HASHADD, cursp(), len);
push();
}
return -1; /* variable length */
}
if (update) return -1;
return len;
}

Expand Down

0 comments on commit b611c43

Please sign in to comment.