René's URL Explorer Experiment


Title: gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `pyexpat` by encukou · Pull Request #135346 · python/cpython · GitHub

Open Graph Title: gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `pyexpat` by encukou · Pull Request #135346 · python/cpython

X Title: gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `pyexpat` by encukou · Pull Request #135346 · python/cpython

Description: AFAIK, to avoid undefined behavior, a function needs to be called via a function pointer of the correct type. For storage, it can be cast to any other function type. It just needs to be cast back, when retrieved. So, we should be able to avoid the union in #134050... but not C function for each setter (or at least one for each type, but SETTER_WRAPPER seems clearer). @picnixz: I didn't test this all the way; will continue tomorrow Issue: gh-133157

Open Graph Description: AFAIK, to avoid undefined behavior, a function needs to be called via a function pointer of the correct type. For storage, it can be cast to any other function type. It just needs to be cast back, ...

X Description: AFAIK, to avoid undefined behavior, a function needs to be called via a function pointer of the correct type. For storage, it can be cast to any other function type. It just needs to be cast back, ...

Opengraph URL: https://github.com/python/cpython/pull/135346

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d2127c58-9f00-9b38-514d-45180346d38e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB1EE:A71F9:4499A6D:5691E87:6B026A03
html-safe-nonce1117cf9788e5341546a5c6872cc871fa0924af976356c1e61c32f22007689999
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUVFOkE3MUY5OjQ0OTlBNkQ6NTY5MUU4Nzo2QjAyNkEwMyIsInZpc2l0b3JfaWQiOiIyMjE2MTkxNTgxNjU5MjI4Njc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace4658cc65bd31c6b10e7472b5028ef84f54318675d32f38124ff9d0852c6dec6
hovercard-subject-tagpull_request:2581316399
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/135346/files
twitter:imagehttps://avatars.githubusercontent.com/u/302922?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/302922?s=400&v=4
og:image:altAFAIK, to avoid undefined behavior, a function needs to be called via a function pointer of the correct type. For storage, it can be cast to any other function type. It just needs to be cast back, ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/135346/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F135346%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F135346%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/135346/files
Reloadhttps://github.com/python/cpython/pull/135346/files
Reloadhttps://github.com/python/cpython/pull/135346/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
encukouhttps://github.com/encukou
python:mainhttps://github.com/python/cpython/tree/main
encukou:fix/ubsan/expat-133157https://github.com/encukou/cpython/tree/fix/ubsan/expat-133157
Conversation 10 https://github.com/python/cpython/pull/135346
Commits 9 https://github.com/python/cpython/pull/135346/commits
Checks 0 https://github.com/python/cpython/pull/135346/checks
Files changed https://github.com/python/cpython/pull/135346/files
Please reload this pagehttps://github.com/python/cpython/pull/135346/files
gh-133157: remove usage of _Py_NO_SANITIZE_UNDEFINED in pyexpat https://github.com/python/cpython/pull/135346/files#top
Show all changes 9 commits https://github.com/python/cpython/pull/135346/files
d0dc245 gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `pyexpat` encukou Jun 10, 2025 https://github.com/python/cpython/pull/135346/commits/d0dc245b3c724e4dcf2be6b711e674df3cb638f3
2d4e590 Restore test from gh-134050 encukou Jun 10, 2025 https://github.com/python/cpython/pull/135346/commits/2d4e59003e267ccc7ea7130a8013ce8a21dbd14f
8b5638d Apply suggestions from code review encukou Jun 11, 2025 https://github.com/python/cpython/pull/135346/commits/8b5638dee82111eacdedbfda30bd148a1693271d
4fd9af8 Use `pyexpat_` prefix encukou Jun 16, 2025 https://github.com/python/cpython/pull/135346/commits/4fd9af8ff359c2f1409bb65f82d56932077d4a1c
865864a Merge in the main branch encukou Jun 16, 2025 https://github.com/python/cpython/pull/135346/commits/865864abeb6623cc90810ff9ac605d014631e6d6
2ad1427 Merge in the main branch encukou Jun 19, 2025 https://github.com/python/cpython/pull/135346/commits/2ad14279db8808a887866be9ecc76d58ec91c706
d587653 Remove the _Py_NO_SANITIZE_UNDEFINED macro encukou Jun 19, 2025 https://github.com/python/cpython/pull/135346/commits/d587653a04f61f46f1735cb8643e6a4103e34fcc
6c14913 Add blurb encukou Jun 19, 2025 https://github.com/python/cpython/pull/135346/commits/6c14913e72444a53e862a7387cbc3c07ed577cd4
f7f1734 Update Misc/NEWS.d/next/C_API/2025-06-19-12-47-18.gh-issue-133157.1WA… encukou Jun 30, 2025 https://github.com/python/cpython/pull/135346/commits/f7f1734aa0cb96c1254401350c2884015d9aa726
Clear filters https://github.com/python/cpython/pull/135346/files
Please reload this pagehttps://github.com/python/cpython/pull/135346/files
Please reload this pagehttps://github.com/python/cpython/pull/135346/files
pyport.h https://github.com/python/cpython/pull/135346/files#diff-4832eab2bfe1a8edc0ca7d7661126bd69d8f4e41916624e3ed48389b6ced6b02
test_pyexpat.py https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
2025-06-19-12-47-18.gh-issue-133157.1WA85f.rst https://github.com/python/cpython/pull/135346/files#diff-44796771ebda4a8fd4e5efaac700881b22b3549a89fafafdb4a704fa55c6cc00
pyexpat.c https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
Include/pyport.hhttps://github.com/python/cpython/pull/135346/files#diff-4832eab2bfe1a8edc0ca7d7661126bd69d8f4e41916624e3ed48389b6ced6b02
View file https://github.com/encukou/cpython/blob/f7f1734aa0cb96c1254401350c2884015d9aa726/Include/pyport.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/135346/{{ revealButtonHref }}
https://github.com/python/cpython/pull/135346/files#diff-4832eab2bfe1a8edc0ca7d7661126bd69d8f4e41916624e3ed48389b6ced6b02
https://github.com/python/cpython/pull/135346/files#diff-4832eab2bfe1a8edc0ca7d7661126bd69d8f4e41916624e3ed48389b6ced6b02
Lib/test/test_pyexpat.pyhttps://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
View file https://github.com/encukou/cpython/blob/f7f1734aa0cb96c1254401350c2884015d9aa726/Lib/test/test_pyexpat.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/135346/{{ revealButtonHref }}
https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
https://github.com/python/cpython/pull/135346/files#diff-bdb65b60742876d0828ee1d7f2c168d36fa02cc202ace32d27c46a7b4a17605d
Misc/NEWS.d/next/C_API/2025-06-19-12-47-18.gh-issue-133157.1WA85f.rsthttps://github.com/python/cpython/pull/135346/files#diff-44796771ebda4a8fd4e5efaac700881b22b3549a89fafafdb4a704fa55c6cc00
View file https://github.com/encukou/cpython/blob/f7f1734aa0cb96c1254401350c2884015d9aa726/Misc/NEWS.d/next/C_API/2025-06-19-12-47-18.gh-issue-133157.1WA85f.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/135346/{{ revealButtonHref }}
Modules/pyexpat.chttps://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
View file https://github.com/encukou/cpython/blob/f7f1734aa0cb96c1254401350c2884015d9aa726/Modules/pyexpat.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/135346/{{ revealButtonHref }}
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
Please reload this pagehttps://github.com/python/cpython/pull/135346/files
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
Please reload this pagehttps://github.com/python/cpython/pull/135346/files
Please reload this pagehttps://github.com/python/cpython/pull/135346/files
https://github.com/python/cpython/pull/135346/files#diff-0534aca0d881f2dd1100e875602f98da60bf20ce127564896dc1e8a92a6fad2c
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.