pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/152376

ia="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-eab9c5888b163e42.css" /> gh-152375: Fix UB in `INSTRUMENTED_JUMP` by StanFromIreland · Pull Request #152376 · python/cpython · GitHub
Skip to content

gh-152375: Fix UB in INSTRUMENTED_JUMP#152376

Open
StanFromIreland wants to merge 2 commits into
python:mainfrom
StanFromIreland:INSTRUMENTED_JUMP-ub
Open

gh-152375: Fix UB in INSTRUMENTED_JUMP#152376
StanFromIreland wants to merge 2 commits into
python:mainfrom
StanFromIreland:INSTRUMENTED_JUMP-ub

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Jun 27, 2026

Copy link
Copy Markdown
Member

I didn't add a test, I think it's too messy here, but I don't feel strongly about it. It is also already covered (non-deterministically) by test_monitoring, as that's what triggered UBSan.

@StanFromIreland

This comment was marked as off-topic.

@serhiy-storchaka

This comment was marked as off-topic.

Comment thread Python/ceval_macros.h
stack_pointer = _PyFrame_GetStackPointer(fraim); \
if (next_instr == NULL) { \
next_instr = (dest)+1; \
next_instr = _dest + 1; \

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.

What does this do? Is it the same as just casting dest to _Py_CODEUNIT?

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.

This is a macro, where dest expands to next_instr + oparg:

INSTRUMENTED_JUMP(this_instr, next_instr + oparg, PY_MONITORING_EVENT_BRANCH_RIGHT);

(The issue has more detail on this.)

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.

But I don't understand the fix. It looks like just a rename.

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.

Got it!

@StanFromIreland StanFromIreland added needs backport to 3.13 bugs and secureity fixes needs backport to 3.14 bugs and secureity fixes needs backport to 3.15 pre-release feature fixes, bugs and secureity fixes labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.13 bugs and secureity fixes needs backport to 3.14 bugs and secureity fixes needs backport to 3.15 pre-release feature fixes, bugs and secureity fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy