-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
truncate i8-s to i1-s when loading constants #32032
Conversation
llvm::LLVMGetInitializer(v) | ||
let d = unsafe { llvm::LLVMGetInitializer(v) }; | ||
if t.is_bool() { | ||
unsafe { llvm::LLVMConstTrunc(d, Type::i1(cx).to_ref()) } |
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.
Isn't there something similar in base::load_ty
, using LLVMGetInitializer
?
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.
This is a variant of load_ty
that uses the const llvm functions.
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.
Nevermind, load_ty
already handles this correctly via to_arg_ty
.
@bors r+ |
📌 Commit cf29344 has been approved by |
nominating for beta since this fixes a regression. |
Fixes #30891
r? @eddyb