Skip to content

Commit e2e9cea

Browse files
[3.15] GH-149501: Fix compilation warning in _YIELD_VALUE uop (GH-149502) (#149737)
GH-149501: Fix compilation warning in `_YIELD_VALUE` uop (GH-149502) (cherry picked from commit 1a79fd0) Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
1 parent 6a66005 commit e2e9cea

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

Modules/_testinternalcapi/test_cases.c.h

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,8 +1867,9 @@ dummy_func(
18671867
assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER);
18681868
#if TIER_ONE && defined(Py_DEBUG)
18691869
if (!PyStackRef_IsNone(frame->f_executable)) {
1870-
int i = frame->instr_ptr - _PyFrame_GetBytecode(frame);
1871-
int opcode = _Py_GetBaseCodeUnit(_PyFrame_GetCode(frame), i).op.code;
1870+
Py_ssize_t i = frame->instr_ptr - _PyFrame_GetBytecode(frame);
1871+
assert(i >= 0 && i <= INT_MAX);
1872+
int opcode = _Py_GetBaseCodeUnit(_PyFrame_GetCode(frame), (int)i).op.code;
18721873
assert(opcode == SEND || opcode == FOR_ITER);
18731874
}
18741875
#endif

Python/executor_cases.c.h

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)