-
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 LLVM IR generated for C-variadic arguments #59577
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
)), | ||
layout: layout, | ||
}; | ||
self.codegen_argument(&mut bx, op, &mut llargs, &fn_ty.args[i]); |
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.
codegen_argument
when called given a function where is_ignore
is true
doesn't do anything other than add padding (which we shouldn't do here for C-variadics), so this section isn't needed.
layout: layout, | ||
}; | ||
self.codegen_argument(&mut bx, op, &mut llargs, &fn_ty.args[i]); | ||
let i = if sig.c_variadic && last_arg_idx.map(|x| i >= x).unwrap_or(false) { |
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.
If we hit the "spoofed" C-variadic argument we need to use i + 1
for each of the subsequent iterations of this loop. If we don't we'll end up using the wrong argument info.
@bors r+ |
📌 Commit 9095feb has been approved by |
Fix LLVM IR generated for C-variadic arguments It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments. Fixes: rust-lang#58881
Failed in #59582 (comment), @bors r- |
Fixed the test. It now passes on the following architectures:
|
It still fails on |
@bors r+
…On Sun, Mar 31, 2019, 18:54 Dan Robertson ***@***.***> wrote:
Fixed the test. It now passes on the following architectures:
- x86_64-unknown-linux-gnu
- i686-unknown-linux-gnu
- i586-unkown-linux-gnu
- aarch64-unknown-linux-gnu
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#59577 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AApc0ixp-Co1ckL6yquwmMFryOZKQdc6ks5vcNpMgaJpZM4cUGRx>
.
|
📌 Commit ebed9e5fb16238dfb09bc4ed23859e391160109f has been approved by |
Ah didn't see the last message. You can have architecture specific codegen
tests now as it is possible to add configurations that compile with
specific flags only. You can see the optimize-attr codegen test for an
example.
@bors r-
|
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit ebed9e5fb16238dfb09bc4ed23859e391160109f has been approved by |
@nagisa Made the |
r? @nagisa |
@dlrobertson It would be fine to |
It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments.
2e97578
to
a9d62be
Compare
After doing some further testing my updated version does not fail on prior versions. As a result, we'll need to use |
@bors r+ |
📌 Commit a9d62be has been approved by |
Fix LLVM IR generated for C-variadic arguments It is possible to create malformed LLVM IR given variadic arguments that are aggregate types. This occurs due to improper tracking of the current argument in the functions list of arguments. Fixes: #58881
☀️ Test successful - checks-travis, status-appveyor |
It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.
Fixes: #58881