Commit 67db8e8
authored
Fix spawn batch bug (#22672)
# Objective
#18670 introduced a small but fatal issue with batch spawning. Previous
tests did not catch this bug because they tested `alloc` and
`alloc_many` separately.
## Solution
- Fix an off by one math mistake in `FreeBufferIterator::next`.
- Fix the part where you need to `ptr.add(index)` if you want the
element at `index`. Whoops.
- Add a test to catch these issues next time
## Testing
- CI
- One new test
- This was originally found
[here](https://discord.com/channels/691052431525675048/749335865876021248/1464359124950319114),
and the reproduction crashes on main but is fine on this branch.1 parent 78166fb commit 67db8e8
1 file changed
+33
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
| |||
1115 | 1118 | | |
1116 | 1119 | | |
1117 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1118 | 1149 | | |
0 commit comments