Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ typedef struct {
PyAPI_FUNC(int) _Py_Instrument(PyCodeObject *co, PyInterpreterState *interp);

// Export for '_testinternalcapi' shared extension
PyAPI_FUNC(_Py_CODEUNIT) _Py_GetBaseCodeUnit(PyCodeObject *code, int offset);
PyAPI_FUNC(_Py_CODEUNIT) _Py_GetBaseCodeUnit(PyCodeObject *code, Py_ssize_t offset);

extern int _PyInstruction_GetLength(PyCodeObject *code, int offset);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the type here as well for consistency?


Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_instruments.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ extern int
_Py_Instrumentation_GetLine(PyCodeObject *code, _PyCoLineInstrumentationData *line_data, int index);

static inline uint8_t
_PyCode_GetOriginalOpcode(_PyCoLineInstrumentationData *line_data, int index)
_PyCode_GetOriginalOpcode(_PyCoLineInstrumentationData *line_data, Py_ssize_t index)
{
return line_data->data[index*line_data->bytes_per_entry];
}
Expand Down
6 changes: 4 additions & 2 deletions Modules/_testinternalcapi/test_cases.c.h

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

3 changes: 2 additions & 1 deletion Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,8 @@ dummy_func(
assert(INLINE_CACHE_ENTRIES_SEND == INLINE_CACHE_ENTRIES_FOR_ITER);
#if TIER_ONE && defined(Py_DEBUG)
if (!PyStackRef_IsNone(frame->f_executable)) {
int i = frame->instr_ptr - _PyFrame_GetBytecode(frame);
Py_ssize_t i = frame->instr_ptr - _PyFrame_GetBytecode(frame);
assert(i > 0);
int opcode = _Py_GetBaseCodeUnit(_PyFrame_GetCode(frame), i).op.code;
assert(opcode == SEND || opcode == FOR_ITER);
}
Expand Down
3 changes: 2 additions & 1 deletion Python/executor_cases.c.h

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

6 changes: 4 additions & 2 deletions Python/generated_cases.c.h

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

2 changes: 1 addition & 1 deletion Python/instrumentation.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ sanity_check_instrumentation(PyCodeObject *code)

/* Get the underlying code unit, stripping instrumentation and ENTER_EXECUTOR */
_Py_CODEUNIT
_Py_GetBaseCodeUnit(PyCodeObject *code, int i)
_Py_GetBaseCodeUnit(PyCodeObject *code, Py_ssize_t i)
{
_Py_CODEUNIT *src_instr = _PyCode_CODE(code) + i;
_Py_CODEUNIT inst = {
Expand Down
Loading