Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions 10 Include/internal/pycore_opcode_metadata.h

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

14 changes: 7 additions & 7 deletions 14 Include/internal/pycore_uop_metadata.h

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

22 changes: 11 additions & 11 deletions 22 Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2604,7 +2604,7 @@ dummy_func(
}

op(_ITER_CHECK_LIST, (iter -- iter)) {
DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type);
EXIT_IF(Py_TYPE(iter) != &PyListIter_Type);
}

replaced op(_ITER_JUMP_LIST, (iter -- iter)) {
Expand Down Expand Up @@ -2633,8 +2633,8 @@ dummy_func(
_PyListIterObject *it = (_PyListIterObject *)iter;
assert(Py_TYPE(iter) == &PyListIter_Type);
PyListObject *seq = it->it_seq;
DEOPT_IF(seq == NULL);
DEOPT_IF((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq));
EXIT_IF(seq == NULL);
EXIT_IF((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq));
}

op(_ITER_NEXT_LIST, (iter -- iter, next)) {
Expand All @@ -2653,7 +2653,7 @@ dummy_func(
_ITER_NEXT_LIST;

op(_ITER_CHECK_TUPLE, (iter -- iter)) {
DEOPT_IF(Py_TYPE(iter) != &PyTupleIter_Type);
EXIT_IF(Py_TYPE(iter) != &PyTupleIter_Type);
}

replaced op(_ITER_JUMP_TUPLE, (iter -- iter)) {
Expand All @@ -2679,8 +2679,8 @@ dummy_func(
_PyTupleIterObject *it = (_PyTupleIterObject *)iter;
assert(Py_TYPE(iter) == &PyTupleIter_Type);
PyTupleObject *seq = it->it_seq;
DEOPT_IF(seq == NULL);
DEOPT_IF(it->it_index >= PyTuple_GET_SIZE(seq));
EXIT_IF(seq == NULL);
EXIT_IF(it->it_index >= PyTuple_GET_SIZE(seq));
}

op(_ITER_NEXT_TUPLE, (iter -- iter, next)) {
Expand All @@ -2700,7 +2700,7 @@ dummy_func(

op(_ITER_CHECK_RANGE, (iter -- iter)) {
_PyRangeIterObject *r = (_PyRangeIterObject *)iter;
DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type);
EXIT_IF(Py_TYPE(r) != &PyRangeIter_Type);
}

replaced op(_ITER_JUMP_RANGE, (iter -- iter)) {
Expand All @@ -2720,7 +2720,7 @@ dummy_func(
op(_GUARD_NOT_EXHAUSTED_RANGE, (iter -- iter)) {
_PyRangeIterObject *r = (_PyRangeIterObject *)iter;
assert(Py_TYPE(r) == &PyRangeIter_Type);
DEOPT_IF(r->len <= 0);
EXIT_IF(r->len <= 0);
}

op(_ITER_NEXT_RANGE, (iter -- iter, next)) {
Expand Down Expand Up @@ -3121,11 +3121,11 @@ dummy_func(
}

op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
DEOPT_IF(!PyFunction_Check(callable));
EXIT_IF(!PyFunction_Check(callable));
PyFunctionObject *func = (PyFunctionObject *)callable;
DEOPT_IF(func->func_version != func_version);
EXIT_IF(func->func_version != func_version);
PyCodeObject *code = (PyCodeObject *)func->func_code;
DEOPT_IF(code->co_argcount != oparg + (self_or_null != NULL));
EXIT_IF(code->co_argcount != oparg + (self_or_null != NULL));
}

op(_CHECK_STACK_SPACE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
Expand Down
2 changes: 1 addition & 1 deletion 2 Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ translate_bytecode_to_trace(
if (expansion->nuops > 0) {
// Reserve space for nuops (+ _SET_IP + _EXIT_TRACE)
int nuops = expansion->nuops;
RESERVE(nuops);
RESERVE(nuops + 1); /* One extra for exit */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm taking this is for gh-117434, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It seems likely to be the same issue, but I haven't checked.

if (expansion->uops[nuops-1].uop == _POP_FRAME) {
// Check for trace stack underflow now:
// We can't bail e.g. in the middle of
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.