Commit 4fc81e8
mruby-compiler: fix crash in pattern matching with string literal
The p_value grammar rule passed raw tSTRING token (a (len . str) cons
cell) directly to new_pat_value() without wrapping it as a proper AST
node. When codegen processed this malformed node, it read the length
field as the node type, causing misinterpretation and crash.
Wrap tSTRING with new_str(p, list1($1)) to create a proper NODE_STR,
consistent with how the primary:string rule handles strings.
Found by ClusterFuzz (oss-fuzz/mruby_fuzzer).
Co-authored-by: Claude <noreply@anthropic.com>1 parent e19b107 commit 4fc81e8
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3986 | 3986 | | |
3987 | 3987 | | |
3988 | 3988 | | |
3989 | | - | |
| 3989 | + | |
3990 | 3990 | | |
3991 | 3991 | | |
3992 | 3992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10540 | 10540 | | |
10541 | 10541 | | |
10542 | 10542 | | |
10543 | | - | |
| 10543 | + | |
10544 | 10544 | | |
10545 | 10545 | | |
10546 | 10546 | | |
| |||
0 commit comments