Commit 298ee65
Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.
Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.
_PyMem_IsPtrFreed() argument is now constant.
(cherry picked from commit 615069e)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 0b47049 commit 298ee65
File tree
4 files changed
+46
-4
lines changed- Include/internal
- Lib/test
- Misc/NEWS.d/next/Core and Builtins
- Objects
4 files changed
+46
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1360 | 1360 | | |
1361 | 1361 | | |
1362 | 1362 | | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1363 | 1391 | | |
1364 | 1392 | | |
1365 | 1393 | | |
| |||
1369 | 1397 | | |
1370 | 1398 | | |
1371 | 1399 | | |
1372 | | - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
1373 | 1405 | | |
1374 | 1406 | | |
1375 | 1407 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1341 | 1341 | | |
1342 | 1342 | | |
1343 | 1343 | | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1344 | 1350 | | |
1345 | 1351 | | |
1346 | 1352 | | |
1347 | 1353 | | |
1348 | 1354 | | |
1349 | 1355 | | |
1350 | 1356 | | |
1351 | | - | |
1352 | | - | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1353 | 1360 | | |
1354 | 1361 | | |
1355 | 1362 | | |
| |||
0 commit comments