Skip to content
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

GH-94739: Mark stacks in exception handlers. #94958

Merged

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jul 18, 2022

@markshannon markshannon added the needs backport to 3.11 only security fixes label Jul 18, 2022
@markshannon markshannon changed the title GH-94739: Mark stacks in exception handers. GH-94739: Mark stacks in exception handlers. Jul 18, 2022
break;
case RETURN_VALUE:
assert(pop_value(next_stack) == 0);
Copy link
Member

Choose a reason for hiding this comment

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

What's this 0?

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see, you're asserting that there is just one item in the stack.

int depth_and_lasti;
scan = parse_varint(scan, &depth_and_lasti);
int level = depth_and_lasti >> 1;
int lasti = depth_and_lasti & 1;
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to assert here that start_offset and handler are in range.

@miss-islington
Copy link
Contributor

Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @markshannon, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 2f8bff6879c5d76d143068e8bc867196a7d28afc 3.11

markshannon added a commit to faster-cpython/cpython that referenced this pull request Jul 18, 2022
markshannon added a commit that referenced this pull request Jul 25, 2022
@markshannon markshannon deleted the mark-exception-stacks-for-jumps branch September 26, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport to 3.11 only security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants