-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[strict provenance] make panic_unwind conform #95494
Copy link
Copy link
Open
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-strict-provenanceArea: Strict provenance for raw pointersArea: Strict provenance for raw pointersO-windowsOperating system: WindowsOperating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)A-strict-provenanceArea: Strict provenance for raw pointersArea: Strict provenance for raw pointersO-windowsOperating system: WindowsOperating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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 | ptrthe valid union of these types isptr.