Use core::ptr::fn_addr_eq for function pointer comparisons - #8430
Use core::ptr::fn_addr_eq for function pointer comparisons#8430kyokuping wants to merge 1 commit into
core::ptr::fn_addr_eq for function pointer comparisons#8430Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesHash slot comparison
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
core::ptr::fn_addr_eq\ for function pointer comparisonscore::ptr::fn_addr_eq for function pointer comparisons
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/ssl.py dependencies:
dependent tests: (53 tests)
[x] lib: cpython/Lib/asyncio dependencies:
dependent tests: (7 tests)
Legend:
|
0bc0e80 to
9d64587
Compare
9d64587 to
690f433
Compare
Assisted-by: Codex-5.6-sol
690f433 to
9ae32de
Compare
|
While trying #8422, I noticed that this code compares function pointers by casting them to integers, so I tried replacing it with However, while this avoids the integer cast, the Miri job still reports UB when comparing this function pointer, so it doesn’t actually improve the current situation. Since this change doesn’t resolve the underlying issue, I’m closing this PR for now. It can be revisited if a Miri-compatible approach is found. |
Assisted-by: Codex-5.6-sol
Summary
core::ptr::fn_addr_eqto preserve pointer provenance.Summary by CodeRabbit