mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.13] gh-126881: fix finalization of dtoa state (GH-126904) (#127395)
gh-126881: fix finalization of dtoa state (GH-126904)
(cherry picked from commit 762c603a86
)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
9bdb0ae5dc
commit
47b0f8f297
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix crash in finalization of dtoa state. Patch by Kumar Aditya.
|
|
@ -1869,7 +1869,6 @@ finalize_interp_clear(PyThreadState *tstate)
|
||||||
_PyXI_Fini(tstate->interp);
|
_PyXI_Fini(tstate->interp);
|
||||||
_PyExc_ClearExceptionGroupType(tstate->interp);
|
_PyExc_ClearExceptionGroupType(tstate->interp);
|
||||||
_Py_clear_generic_types(tstate->interp);
|
_Py_clear_generic_types(tstate->interp);
|
||||||
_PyDtoa_Fini(tstate->interp);
|
|
||||||
|
|
||||||
/* Clear interpreter state and all thread states */
|
/* Clear interpreter state and all thread states */
|
||||||
_PyInterpreterState_Clear(tstate);
|
_PyInterpreterState_Clear(tstate);
|
||||||
|
@ -1891,6 +1890,9 @@ finalize_interp_clear(PyThreadState *tstate)
|
||||||
|
|
||||||
finalize_interp_types(tstate->interp);
|
finalize_interp_types(tstate->interp);
|
||||||
|
|
||||||
|
/* Finalize dtoa at last so that finalizers calling repr of float doesn't crash */
|
||||||
|
_PyDtoa_Fini(tstate->interp);
|
||||||
|
|
||||||
/* Free any delayed free requests immediately */
|
/* Free any delayed free requests immediately */
|
||||||
_PyMem_FiniDelayed(tstate->interp);
|
_PyMem_FiniDelayed(tstate->interp);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue