Title: Replace unsafe pointer cast with PyMutex in PyCode by youknowone · Pull Request #7055 · RustPython/RustPython · GitHub
Open Graph Title: Replace unsafe pointer cast with PyMutex in PyCode by youknowone · Pull Request #7055 · RustPython/RustPython
X Title: Replace unsafe pointer cast with PyMutex in PyCode by youknowone · Pull Request #7055 · RustPython/RustPython
Description: Add source_path: PyMutex<&'static PyStrInterned> field to PyCode for interior mutability, replacing the UB-inducing #[allow(invalid_reference_casting)] + write_volatile pattern in update_code_filenames. Update all 12 read sites across the codebase to use the new source_path() method. Summary by CodeRabbit Refactor Improved thread-safety and safer handling of code object source paths across the runtime by replacing direct internal field access and in-place mutations with controlled accessors and setters, reducing unsafe mutations and standardizing path retrieval in traceback, import, and warning/reporting flows.
Open Graph Description: Add source_path: PyMutex<&'static PyStrInterned> field to PyCode for interior mutability, replacing the UB-inducing #[allow(invalid_reference_casting)] + write_volatile pattern in upd...
X Description: Add source_path: PyMutex<&'static PyStrInterned> field to PyCode for interior mutability, replacing the UB-inducing #[allow(invalid_reference_casting)] + write_volatil...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7055
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5f071f11-abd7-40cb-dd54-d75274d4a28e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DAEC:290EEE:10743FA:159EDE8:6A5C438A |
| html-safe-nonce | e828fa6cda2a58ed55b7cb5aa3ca486dfa9dbaa48ba359c8ca2ae76deeeadfbb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUVDOjI5MEVFRToxMDc0M0ZBOjE1OUVERTg6NkE1QzQzOEEiLCJ2aXNpdG9yX2lkIjoiNzI1NDU5NDA4OTk3MDg0NDU1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3995b4f8431400724ff8b0ef4aeccf896654192ba034436736088e4a62cb58d2 |
| hovercard-subject-tag | pull_request:3260631143 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7055/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | Add source_path: PyMutex<&'static PyStrInterned> field to PyCode for interior mutability, replacing the UB-inducing #[allow(invalid_reference_casting)] + write_volatile pattern in upd... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width