diff options
author | Mark Shannon <mark@hotpy.org> | 2025-04-02 15:31:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-02 15:31:59 (GMT) |
commit | ad053d8d6afcb6452336b42528a0530c609bfff4 (patch) | |
tree | 7281c666153e325a3bbe3d2ed7bcb361f70e834b /Python/bytecodes.c | |
parent | 6e91d1f9aafc6e375092b8c14f6e30ebc74e4004 (diff) | |
download | cpython-ad053d8d6afcb6452336b42528a0530c609bfff4.zip cpython-ad053d8d6afcb6452336b42528a0530c609bfff4.tar.gz cpython-ad053d8d6afcb6452336b42528a0530c609bfff4.tar.bz2 |
GH-131498: Cases generator: Parse down to C statement level. (GH-131948)
* Parse down to statement level in the cases generator
* Add handling for #if macros, treating them much like normal ifs.
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 8d7e137..b2900ba 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -163,7 +163,7 @@ dummy_func( op(_CHECK_PERIODIC_IF_NOT_YIELD_FROM, (--)) { if ((oparg & RESUME_OPARG_LOCATION_MASK) < RESUME_AFTER_YIELD_FROM) { _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY(); - QSBR_QUIESCENT_STATE(tstate); \ + QSBR_QUIESCENT_STATE(tstate); if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) { int err = _Py_HandlePending(tstate); ERROR_IF(err != 0, error); @@ -2245,7 +2245,8 @@ dummy_func( PyObject *attr_o = FT_ATOMIC_LOAD_PTR_ACQUIRE(*value_ptr); DEOPT_IF(attr_o == NULL); #ifdef Py_GIL_DISABLED - if (!_Py_TryIncrefCompareStackRef(value_ptr, attr_o, &attr)) { + int increfed = _Py_TryIncrefCompareStackRef(value_ptr, attr_o, &attr); + if (!increfed) { DEOPT_IF(true); } #else @@ -2322,7 +2323,8 @@ dummy_func( } STAT_INC(LOAD_ATTR, hit); #ifdef Py_GIL_DISABLED - if (!_Py_TryIncrefCompareStackRef(&ep->me_value, attr_o, &attr)) { + int increfed = _Py_TryIncrefCompareStackRef(&ep->me_value, attr_o, &attr); + if (!increfed) { DEOPT_IF(true); } #else |