-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[strict provenance] Rationalize "Oxford Casts" #95489
Copy link
Copy link
Open
Labels
A-strict-provenanceArea: Strict provenance for raw pointersArea: Strict provenance for raw pointersO-AVRTarget: AVR processors (ATtiny, ATmega, etc.)Target: AVR processors (ATtiny, ATmega, etc.)O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-strict-provenanceArea: Strict provenance for raw pointersArea: Strict provenance for raw pointersO-AVRTarget: AVR processors (ATtiny, ATmega, etc.)Target: AVR processors (ATtiny, ATmega, etc.)O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
This issue is part of the Strict Provenance Experiment - #95228
Oxford Casts are those that fly in the face of Harvard Architectures, and let you convert between data pointers and function pointers. In my current understanding, this affects both AVR and WASM.
For WASM, function pointers are actually indices into a ~vtable somewhere. This seems to mostly work fine and it's just a matter of "ask bad questions, get bad answers"
For AVR it causes Actual Compiler Problems that the stdlib seems to be actively routing around:
rust/library/core/src/ptr/mod.rs
Lines 1390 to 1395 in 9280445
I do not know what "resolving" this looks like. It could involve any of:
I can't really help any more than this, because this is all outside my areas of expertese/motivation.