Uh oh!
There was an error while loading. Please reload this page.
Fix CFI: f32 and f64 are encoded incorrectly for cross-language CFI - #115151
Conversation
rustbot
commented
Aug 23, 2023
(rustbot has picked a reviewer for you, use r? to override) |
rcvalle
commented
Aug 23, 2023
r? @bjorn3 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Would it be better to link to something describing the f and d prefixes that the encoding expects for IEEE-754 floats?
There was a problem hiding this comment.
Humm... those are just the Itanium C++ encoding for these builtin types (see https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin). Instead of referencing it, I think it makes more sense to explain why they can be directly used here (similarly to how it's explained in line 446 for ty::Bool). What do you think?
Fixrust-lang#115150 by encoding f32 and f64 correctly for cross-language CFI. I missed changing the encoding for f32 and f64 when I introduced the integer normalization option in rust-lang#105452 as integer normalization does not include floating point. `f32` and `f64` should be always encoded as `f` and `d` since they are both FFI safe when their representation are the same (i.e., IEEE 754) for both the Rust compiler and Clang.
d9f2b60 to
5d6e2d7Comparecompiler-errors
commented
Aug 25, 2023
@bors r+ rollup |
bors
commented
Aug 25, 2023
rcvalle
commented
Aug 25, 2023
Thank you for your time, @compiler-errors! Much appreciated. |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#114754 (Name what ln_gamma does) - rust-lang#115081 (Allow overwriting ExpnId for concurrent decoding) - rust-lang#115151 (Fix CFI: f32 and f64 are encoded incorrectly for cross-language CFI) - rust-lang#115169 (remove some unnecessary ignore-debug clauses) - rust-lang#115190 (Add comment to the push_trailing function) r? `@ghost` `@rustbot` modify labels: rollup
Fix#115150 by encoding f32 and f64 correctly for cross-language CFI. I missed changing the encoding for f32 and f64 when I introduced the integer normalization option in #105452 as integer normalization does not include floating point.
f32andf64should be always encoded asfanddsince they are both FFI safe when their representation are the same (i.e., IEEE 754) for both the Rust compiler and Clang.