Commit b01ca88
committed
fix bdb: use slice copy in clear_all_file_breaks to avoid iterate-and-delete bug (gh-149015)
When multiple breakpoints share the same (filename, line), iterating the list
directly while calling deleteMe() (which removes from the same list) causes the
loop to skip alternate elements, leaving floor(N/2) orphan breakpoints.
The fix (for bp in blist: → for bp in blist[:]:) matches the existing defensive
pattern already used in clear_break() in the same file.
Added regression test test_clear_all_file_breaks_with_multiple_bps_same_line.1 parent 804c213 commit b01ca88
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
| 750 | + | |
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1235 | 1252 | | |
1236 | 1253 | | |
1237 | 1254 | | |
| |||
0 commit comments