Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Cases generator: Track reachability and divergent stacks in if statem…
…ents.
  • Loading branch information
markshannon committed Aug 8, 2024
commit 4673d8a929988bf0f867a2e37b2a4db91fac072c
18 changes: 13 additions & 5 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,9 @@ dummy_func(
int err = _Py_call_instrumentation_arg(
tstate, PY_MONITORING_EVENT_PY_RETURN,
frame, this_instr, PyStackRef_AsPyObjectBorrow(val));
if (err) ERROR_NO_POP();
if (err) {
ERROR_NO_POP();
}
}

macro(INSTRUMENTED_RETURN_VALUE) =
Expand Down Expand Up @@ -1154,7 +1156,9 @@ dummy_func(
tstate, PY_MONITORING_EVENT_PY_YIELD,
frame, this_instr, PyStackRef_AsPyObjectBorrow(val));
LOAD_SP();
if (err) ERROR_NO_POP();
if (err) {
ERROR_NO_POP();
}
if (frame->instr_ptr != this_instr) {
next_instr = frame->instr_ptr;
DISPATCH();
Expand Down Expand Up @@ -1262,10 +1266,12 @@ dummy_func(
DECREF_INPUTS();
ERROR_IF(true, error);
}
if (PyDict_CheckExact(ns))
if (PyDict_CheckExact(ns)) {
err = PyDict_SetItem(ns, name, PyStackRef_AsPyObjectBorrow(v));
else
}
else {
err = PyObject_SetItem(ns, name, PyStackRef_AsPyObjectBorrow(v));
}
DECREF_INPUTS();
ERROR_IF(err, error);
}
Expand Down Expand Up @@ -4134,7 +4140,9 @@ dummy_func(
int err = _Py_call_instrumentation_2args(
tstate, PY_MONITORING_EVENT_CALL,
frame, this_instr, func, arg);
if (err) ERROR_NO_POP();
if (err) {
ERROR_NO_POP();
}
result = PyStackRef_FromPyObjectSteal(PyObject_Call(func, callargs, kwargs));

if (!PyFunction_Check(func) && !PyMethod_Check(func)) {
Expand Down
10 changes: 6 additions & 4 deletions Python/executor_cases.c.h

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

142 changes: 78 additions & 64 deletions Python/generated_cases.c.h

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

Loading