8000 GH-118093: Better handling of short and mid-loop traces by brandtbucher · Pull Request #122252 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-118093: Better handling of short and mid-loop traces #122252

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 10 commits into from
Jul 29, 2024
Prev Previous commit
Next Next commit
Guard _Py_GetExecutor on non-tier-two builds
  • Loading branch information
brandtbucher committed Jul 26, 2024
commit 7c404a8dea42300d90f81602c09058898fc0bcf5
2 changes: 2 additions & 0 deletions Objects/genobject.c
4AC6
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,17 @@
is_resume(_PyInterpreterFrame *frame, uint8_t *oparg_p)
{
PyCodeObject *code = _PyFrame_GetCode(frame);
int offset = frame->instr_ptr - _PyCode_CODE(code);

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 334 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
uint8_t opcode = _Py_GetBaseOpcode(code, offset);
uint8_t oparg = frame->instr_ptr->op.arg;
#ifdef _Py_TIER2
if (opcode == ENTER_EXECUTOR) {
_PyExecutorObject *executor = _Py_GetExecutor(code, sizeof(_Py_CODEUNIT) * offset);
opcode = _PyOpcode_Deopt[executor->vm_data.opcode];
oparg = executor->vm_data.oparg;
Py_DECREF(executor);
}
#endif
if (opcode == RESUME) {
*oparg_p = oparg;
return true;
Expand All @@ -353,7 +355,7 @@
if (gen->gi_frame_state == FRAME_SUSPENDED_YIELD_FROM) {
_PyInterpreterFrame *frame = &gen->gi_iframe;
#ifndef NDEBUG
uint8_t oparg;

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (1.1.1w)

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.0.13)

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.5)

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.2.1)

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Check warning on line 358 in Objects/genobject.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test

‘oparg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
assert(is_resume(frame, &oparg));
assert((oparg & RESUME_OPARG_LOCATION_MASK) >= RESUME_AFTER_YIELD_FROM);
#endif
Expand Down
Loading
0