Commit da2d652
codegen.c: fix NODE_MATCH_PAT to push result when val is true
Pattern matching expressions were not pushing a result value in several
code paths when used in value context (e.g., string interpolation).
This caused crashes when the result was expected on the stack.
Fix all code paths in NODE_MATCH_PAT to push the appropriate value:
- 'in' pattern returns true/false
- '=>' pattern returns nil (matches CRuby behavior)
Co-authored-by: Claude <noreply@anthropic.com>1 parent f6f8124 commit da2d652
1 file changed
+41
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6520 | 6520 | | |
6521 | 6521 | | |
6522 | 6522 | | |
6523 | | - | |
| 6523 | + | |
6524 | 6524 | | |
6525 | 6525 | | |
6526 | 6526 | | |
6527 | 6527 | | |
| 6528 | + | |
| 6529 | + | |
| 6530 | + | |
| 6531 | + | |
| 6532 | + | |
| 6533 | + | |
| 6534 | + | |
| 6535 | + | |
| 6536 | + | |
| 6537 | + | |
| 6538 | + | |
6528 | 6539 | | |
6529 | 6540 | | |
6530 | 6541 | | |
| |||
6561 | 6572 | | |
6562 | 6573 | | |
6563 | 6574 | | |
6564 | | - | |
6565 | | - | |
6566 | | - | |
6567 | | - | |
| 6575 | + | |
| 6576 | + | |
| 6577 | + | |
| 6578 | + | |
| 6579 | + | |
| 6580 | + | |
| 6581 | + | |
| 6582 | + | |
| 6583 | + | |
6568 | 6584 | | |
6569 | 6585 | | |
6570 | 6586 | | |
| |||
6595 | 6611 | | |
6596 | 6612 | | |
6597 | 6613 | | |
6598 | | - | |
6599 | | - | |
| 6614 | + | |
| 6615 | + | |
| 6616 | + | |
| 6617 | + | |
| 6618 | + | |
| 6619 | + | |
| 6620 | + | |
| 6621 | + | |
6600 | 6622 | | |
6601 | 6623 | | |
6602 | 6624 | | |
| |||
6644 | 6666 | | |
6645 | 6667 | | |
6646 | 6668 | | |
| 6669 | + | |
| 6670 | + | |
| 6671 | + | |
| 6672 | + | |
| 6673 | + | |
| 6674 | + | |
| 6675 | + | |
| 6676 | + | |
| 6677 | + | |
| 6678 | + | |
| 6679 | + | |
| 6680 | + | |
6647 | 6681 | | |
6648 | 6682 | | |
6649 | 6683 | | |
| |||
0 commit comments