Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-120024: Move three more escaping calls out of conditional statements #122734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions 16 Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ dummy_func(
uintptr_t global_version = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & ~_PY_EVAL_EVENTS_MASK;
uintptr_t code_version = FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version);
if (code_version != global_version && tstate->tracing == 0) {
if (_Py_Instrument(_PyFrame_GetCode(frame), tstate->interp)) {
int err = _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp);
if (err) {
ERROR_NO_POP();
}
next_instr = this_instr;
Expand Down Expand Up @@ -1802,7 +1803,12 @@ dummy_func(
assert(PyDict_CheckExact(dict));
/* dict[key] = value */
// Do not DECREF INPUTS because the function steals the references
ERROR_IF(_PyDict_SetItem_Take2((PyDictObject *)dict, PyStackRef_AsPyObjectSteal(key), PyStackRef_AsPyObjectSteal(value)) != 0, error);
int err = _PyDict_SetItem_Take2(
(PyDictObject *)dict,
PyStackRef_AsPyObjectSteal(key),
PyStackRef_AsPyObjectSteal(value)
);
ERROR_IF(err != 0, error);
}

inst(INSTRUMENTED_LOAD_SUPER_ATTR, (unused/1, unused, unused, unused -- unused, unused if (oparg & 1))) {
Expand Down Expand Up @@ -2455,7 +2461,8 @@ dummy_func(
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);

assert(PyExceptionInstance_Check(left_o));
if (_PyEval_CheckExceptTypeValid(tstate, right_o) < 0) {
int err = _PyEval_CheckExceptTypeValid(tstate, right_o);
if (err < 0) {
DECREF_INPUTS();
ERROR_IF(true, error);
}
Expand Down Expand Up @@ -4107,7 +4114,8 @@ dummy_func(
// It converts all dict subtypes in kwargs into regular dicts.
assert(kwargs == NULL || PyDict_CheckExact(kwargs));
if (!PyTuple_CheckExact(callargs)) {
if (check_args_iterable(tstate, func, callargs) < 0) {
int err = check_args_iterable(tstate, func, callargs);
if (err < 0) {
ERROR_NO_POP();
}
PyObject *tuple = PySequence_Tuple(callargs);
Expand Down
10 changes: 8 additions & 2 deletions 10 Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions 16 Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.