-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix invalid bitcast taking bool out of a union represented as a scalar #56097
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
bx.bitcast(val, ty) | ||
} | ||
}; | ||
|
||
// HACK(eddyb) have to bitcast pointers until LLVM removes pointee types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another comment that mentions that we also need to truncate bool union fields?
Also, the comment should be above the closure.
@@ -243,14 +243,22 @@ impl<'a, 'tcx: 'a, V: CodegenObject> OperandRef<'tcx, V> { | |||
_ => bug!("OperandRef::extract_field({:?}): not applicable", self) | |||
}; | |||
|
|||
let bitcast = |bx: &mut Bx, val, ty| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name isn't perfect, maybe rename to to_immediate_or_cast
?
@bors r+ |
📌 Commit 4c21f66 has been approved by |
Fix invalid bitcast taking bool out of a union represented as a scalar As reported in rust-lang#54668 (comment)
Rollup of 14 pull requests Successful merges: - #55767 (Disable some pretty-printers when gdb is rust-enabled) - #55838 (Fix #[cfg] for step impl on ranges) - #55869 (Add std::iter::unfold) - #55945 (Ensure that the argument to `static_assert` is a `bool`) - #56022 (When popping in CTFE, perform validation before jumping to next statement to have a better span for the error) - #56048 (Add rustc_codegen_ssa to sysroot) - #56091 (Fix json output in the self-profiler) - #56097 (Fix invalid bitcast taking bool out of a union represented as a scalar) - #56116 (ci: Download clang/lldb from tarballs) - #56120 (Add unstable Literal::subspan().) - #56154 (Pass additional linker flags when targeting Fuchsia) - #56162 (std::str Adapt documentation to reality) - #56163 ([master] Backport 1.30.1 release notes) - #56168 (Fix the tracking issue for hash_raw_entry) Failed merges: r? @ghost
As reported in #54668 (comment)