mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: negative zero equals to positive zero.
`OP_LOADI Rn -0` should be `OP_LOADI_0`.
This commit is contained in:
@@ -2663,6 +2663,9 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
int off = new_litbn(s, p, base, TRUE);
|
||||
genop_2(s, OP_LOADL, cursp(), off);
|
||||
}
|
||||
else if (i == 0) {
|
||||
genop_1(s, OP_LOADI_0, cursp());
|
||||
}
|
||||
else {
|
||||
i = -i;
|
||||
if (i == -1) genop_1(s, OP_LOADI__1, cursp());
|
||||
|
||||
Reference in New Issue
Block a user