bpo-34126: fix crashes while profiling certain invalid calls by jdemeyer · Pull Request #8300 · python/cpython
jdemeyer
changed the title
bpo-34126: fix crashes while profiling invalid calls
bpo-34126: fix crashes while profiling certain invalid calls
| // We need to create PyCFunctionObject for tracing. | ||
| PyMethodDescrObject *descr = (PyMethodDescrObject*)func; | ||
| func = PyCFunction_NewEx(descr->d_method, stack[0], NULL); | ||
| if (nargs > 0 && tstate->use_tracing) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the check for tstate->c_profilefunc is missed?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That check is actually redundant. The old code was checking tstate->use_tracing && tstate->c_profilefunc twice (once here and once in the C_TRACE macro). It's not wrong to keep the additional tstate->c_profilefunc check but it's just not needed.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Jul 21, 2018(cherry picked from commit 56868f9) Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
serhiy-storchaka pushed a commit that referenced this pull request
Jul 21, 2018) (cherry picked from commit 56868f9) Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
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