8000 GH-94438: Account for NULLs on evaluation stack when jumping lines. by markshannon · Pull Request #94444 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-94438: Account for NULLs on evaluation stack when jumping lines. #94444

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 4 commits into from
Jul 1, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Handle LOAD_ATTR in frame.setlineno stack analysis.
  • Loading branch information
markshannon committed Jul 1, 2022
commit 5876efe1a5a24f90d4557a5b816ffd0358fed614
16 changes: 15 additions & 1 deletion Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,26 @@ mark_stacks(PyCodeObject *code_obj, int len)
stacks[i+1] = next_stack;
break;
case LOAD_GLOBAL:
if (_Py_OPARG(code[i]) & 1) {
{
int j = get_arg(code, i);
if (j & 1) {
next_stack = push_value(next_stack, Null);
}
next_stack = push_value(next_stack, Object);
stacks[i+1] = next_stack;
break;
}
case LOAD_ATTR:
{
int j = get_arg(code, i);
if (j & 1) {
next_stack = pop_value(next_stack);
next_stack = push_value(next_stack, Null);
next_stack = push_value(next_stack, Object);
}
stacks[i+1] = next_stack;
break;
}
default:
{
int delta = PyCompile_OpcodeStackEffect(opcode, _Py_OPARG(code[i]));
Expand Down
0