FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-122081: fixed crash in decimal.IEEEContext() by skirpichev · Pull Request #122082 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a crash in the :func:`!decimal.IEEEContext` optional function
available via the ``EXTRA_FUNCTIONALITY`` configuration flag.
4 changes: 2 additions & 2 deletions Modules/_decimal/_decimal.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ init_extended_context(PyObject *v)
#ifdef EXTRA_FUNCTIONALITY
/* Factory function for creating IEEE interchange format contexts */
static PyObject *
ieee_context(PyObject *dummy UNUSED, PyObject *v)
ieee_context(PyObject *module, PyObject *v)
{
PyObject *context;
mpd_ssize_t bits;
Expand All @@ -1536,7 +1536,7 @@ ieee_context(PyObject *dummy UNUSED, PyObject *v)
goto error;
}

decimal_state *state = get_module_state_by_def(Py_TYPE(v));
decimal_state *state = get_module_state(module);
context = PyObject_CallObject((PyObject *)state->PyDecContext_Type, NULL);
if (context == NULL) {
return NULL;
Expand Down

Back | FazBrowse Home | New Git URL