gh-126881: fix finalization of dtoa state (#126904)

This commit is contained in:
Kumar Aditya 2024-11-29 15:17:16 +05:30 committed by GitHub
parent dd3a87d2a8
commit 762c603a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix crash in finalization of dtoa state. Patch by Kumar Aditya.

View file

@ -1888,7 +1888,6 @@ finalize_interp_clear(PyThreadState *tstate)
_PyXI_Fini(tstate->interp);
_PyExc_ClearExceptionGroupType(tstate->interp);
_Py_clear_generic_types(tstate->interp);
_PyDtoa_Fini(tstate->interp);
/* Clear interpreter state and all thread states */
_PyInterpreterState_Clear(tstate);
@ -1910,6 +1909,9 @@ finalize_interp_clear(PyThreadState *tstate)
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 */
_PyMem_FiniDelayed(tstate->interp);