Repository navigation
Commit 0044e19
committed
gh-162752: Assert the type lock is kept while checking subclass slots
slots_are_generic() iterates tp_subclasses with a borrowed reference,
which is only safe while TYPE_LOCK is held: a __bases__ assignment in
another thread can empty and free that dict. Nothing fails visibly if
the lock is dropped during the walk (the freed dict is usually reused),
so assert that the dict is still the one being iterated. With this,
test_slot_update_unchanged_race fails if the walk blocks.
Co-authored with Claude Fable 5.21 parent 5d1926d commit 0044e19
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12412 | 12412 | | |
12413 | 12413 | | |
12414 | 12414 | | |
| 12415 | + | |
| 12416 | + | |
12415 | 12417 | | |
12416 | 12418 | | |
12417 | 12419 | | |
| |||
0 commit comments