Yukihiro "Matz" Matsumoto
d1aa722a98
mruby-compiler: fix JMPNOT+JMP optimization for nested alternatives
...
The previous optimization for converting JMPNOT+JMP to JMPIF in
alternative patterns had two bugs:
1. It triggered incorrectly for nested alternatives like `1 | 2 | 3`
(parsed as `((1|2)|3)`), causing memory corruption.
2. The chain end detection was wrong - it checked `prev_offset == 0`
but the chain actually ends when `(pos+2) + offset == 0`.
Fix by:
- Only applying optimization when left pattern is not NODE_PAT_ALT
- Correctly detecting chain end by checking if next_addr == 0
- Properly unlinking the last JMPNOT from the fail chain
Co-authored-by: Claude <noreply@anthropic.com >
2025-12-25 18:01:43 +09:00
..
2025-10-16 09:59:03 +09:00
2025-10-16 09:59:03 +09:00
2025-10-16 09:59:03 +09:00
2025-10-16 09:59:03 +09:00
2025-10-16 16:54:25 +09:00
2025-10-20 08:11:59 +09:00
2025-10-25 21:05:39 +09:00
2025-10-16 17:02:23 +09:00
2025-12-11 18:09:08 +09:00
2025-12-11 18:09:09 +09:00
2025-12-01 18:20:44 +09:00
2025-12-11 18:09:10 +09:00
2025-12-11 18:09:10 +09:00
2025-12-22 11:24:12 +09:00
2025-12-11 18:09:10 +09:00
2025-12-21 17:26:49 +09:00
2025-12-11 18:09:10 +09:00
2025-11-12 10:25:36 +09:00
2025-08-14 10:52:47 +09:00
2025-10-14 08:22:41 +09:00
2025-10-08 23:55:23 +09:00
2025-08-14 10:52:49 +09:00
2025-12-25 18:01:43 +09:00
2025-12-11 18:09:08 +09:00
2025-08-14 10:52:49 +09:00
2025-11-08 14:27:44 +09:00
2025-12-23 10:41:21 +09:00
2025-12-11 18:09:06 +09:00
2025-12-11 18:09:09 +09:00
2025-12-11 18:09:09 +09:00
2025-12-11 18:09:07 +09:00
2025-10-27 07:59:20 +09:00
2025-11-08 14:26:49 +09:00
2025-12-23 08:34:52 +09:00
2025-08-14 10:52:49 +09:00
2025-10-18 23:34:10 +09:00
2025-12-11 18:09:09 +09:00
2025-12-18 16:30:03 +09:00
2025-11-12 10:25:37 +09:00
2025-10-26 23:30:14 +09:00
2025-11-29 01:46:54 +10:00
2025-12-11 18:09:10 +09:00
2025-08-14 10:53:12 +09:00
2025-12-11 18:09:07 +09:00
2025-08-14 10:52:49 +09:00
2025-06-24 13:56:07 +09:00
2025-12-23 11:02:34 +09:00
2025-11-08 14:24:40 +09:00
2025-10-26 20:33:06 +09:00
2025-11-29 01:46:54 +10:00
2025-11-29 01:46:54 +10:00
2025-12-23 08:50:30 +09:00
2025-12-11 18:09:10 +09:00
2025-10-26 20:01:30 +09:00
2025-12-11 18:09:11 +09:00
2025-12-23 11:27:47 +09:00
2025-10-26 19:16:12 +09:00
2025-12-23 10:41:21 +09:00
2025-12-11 18:09:09 +09:00
2025-08-14 10:52:49 +09:00
2025-11-08 14:14:44 +09:00
2025-11-16 06:53:02 +09:00
2024-09-24 00:14:24 +10:00
2025-12-01 18:20:44 +09:00
2025-08-14 10:52:47 +09:00
2021-01-06 18:10:21 +09:00
2021-01-06 18:10:21 +09:00
2023-04-04 19:31:42 +10:00
2025-10-08 23:55:21 +09:00
2025-05-14 15:58:23 +09:00
2025-05-14 15:58:24 +09:00
2022-11-29 15:58:05 +09:00
2025-01-06 13:57:23 +09:00
2025-05-19 08:00:36 +09:00