Commit 585469a
committed
merge revision(s) 5ec9a39: [Backport #21439]
[Bug #21439] Fix `PM_SPLAT_NODE` compilation error in for loops (ruby#13597)
[Bug #21439] Fix PM_SPLAT_NODE compilation error in for loops
This commit fixes a crash that occurred when using splat nodes (*) as
the index variable in for loops. The error "Unexpected node type for
index in for node: PM_SPLAT_NODE" was thrown because the compiler
didn't know how to handle splat nodes in this context.
The fix allows code like `for *x in [[1,2], [3,4]]` to compile and
execute correctly, where the splat collects each sub-array.1 parent 79b73dd commit 585469a
3 files changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5120 | 5120 | | |
5121 | 5121 | | |
5122 | 5122 | | |
| 5123 | + | |
| 5124 | + | |
| 5125 | + | |
| 5126 | + | |
| 5127 | + | |
| 5128 | + | |
| 5129 | + | |
| 5130 | + | |
| 5131 | + | |
| 5132 | + | |
| 5133 | + | |
| 5134 | + | |
| 5135 | + | |
| 5136 | + | |
5123 | 5137 | | |
5124 | 5138 | | |
5125 | 5139 | | |
| |||
5233 | 5247 | | |
5234 | 5248 | | |
5235 | 5249 | | |
5236 | | - | |
| 5250 | + | |
| 5251 | + | |
5237 | 5252 | | |
5238 | 5253 | | |
5239 | 5254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1050 | 1053 | | |
1051 | 1054 | | |
1052 | 1055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments