Commit eee67f1
committed
Rollback id_map on width validation failure to prevent undefined IDs
When width validation in emit_pattern detected a mismatch and returned
None, IDs allocated by recursive emit_term calls remained in id_map.
Later extractions could find these stale entries via constant dedup
keys (e.g. "const_<type>_42"), referencing IDs for instructions that
were never emitted — causing "use of undefined id" validation errors.
Save next_id before the operand emission loop and restore it (along
with pruning id_map) when width validation fails.1 parent eb06849 commit eee67f1
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1325 | 1325 | | |
1326 | 1326 | | |
1327 | 1327 | | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1328 | 1331 | | |
1329 | 1332 | | |
1330 | 1333 | | |
| |||
1337 | 1340 | | |
1338 | 1341 | | |
1339 | 1342 | | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1340 | 1348 | | |
1341 | 1349 | | |
1342 | 1350 | | |
1343 | 1351 | | |
1344 | 1352 | | |
1345 | 1353 | | |
1346 | 1354 | | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1347 | 1360 | | |
1348 | 1361 | | |
1349 | 1362 | | |
| |||
0 commit comments