Files
mruby-mruby/test/t
Yukihiro "Matz" Matsumoto b4f6450509 mruby-compiler: do not flip + and - opcode for negative literal
The peephole in gen_addsub() rewrote `q + -n` into OP_SUBI n (and
`q - -n` into OP_ADDI n) by negating n. For numeric receivers this is
equivalent, but for receivers overriding + or - the runtime fallback
dispatches the flipped method, losing the original operator. Restrict
the fold to non-negative immediates; negative falls through to the
normal OP_ADD/OP_SUB path with LOADI of the literal value.

close #2557
ref #2579

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-09 19:47:27 +09:00
..
2021-11-26 12:18:41 +09:00
2021-03-01 10:06:17 +10:00
2026-05-07 15:51:30 +00:00
2025-01-26 21:11:21 +09:00
2021-03-01 10:06:17 +10:00
2021-03-01 10:06:17 +10:00
2026-02-07 16:47:39 +09:00
2021-05-03 15:30:59 +09:00
2021-06-16 08:34:54 +10:00