[strict provenance] make panic_unwind conform #95494
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
A-strict-provenance
Area: Strict provenance for raw pointers
O-windows
Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This issue is part of the Strict Provenance Experiment - #95228
The panic_unwind component is full of lots of pointer provenance crimes.
In particular, I noticed that dwarf/eh.rs is just a complete hairball of uniformly mixing pointers and integers:
rust/library/panic_unwind/src/dwarf/eh.rs
Lines 144 to 148 in bb5c437
And seh.rs has some sketchy stuff too:
rust/library/panic_unwind/src/seh.rs
Lines 129 to 134 in bb5c437
I ran into this fairly early, so these seemed like pretty overwhelmingly hard problems at the time, but with a bit of time to sleep on it I think it might be possible to fix a lot of this by just making everything be pointers by default and then if you "notice" something is actually an offset, only cast it to an integer at that point.
In general it's ok for integers to pretend to be pointers "for fun", and if anything is ever
int | ptr
the valid union of these types isptr
.The text was updated successfully, but these errors were encountered: