Description
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 is ptr
.