Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 26bf0ef

Browse files
authoredAug 8, 2021
Merge branch 'rust-lang:master' into master
2 parents 75e8035 + 798446f commit 26bf0ef

File tree

44 files changed

+528
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+528
-319
lines changed
 

‎Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4795,9 +4795,9 @@ checksum = "da73c8f77aebc0e40c300b93f0a5f1bece7a248a36eee287d4e095f35c7b7d6e"
47954795

47964796
[[package]]
47974797
name = "socket2"
4798-
version = "0.4.0"
4798+
version = "0.4.1"
47994799
source = "registry+https://github.com/rust-lang/crates.io-index"
4800-
checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2"
4800+
checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad"
48014801
dependencies = [
48024802
"libc",
48034803
"winapi",

‎compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,11 @@ pub trait FnAbiLlvmExt<'tcx> {
353353

354354
impl<'tcx> FnAbiLlvmExt<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
355355
fn llvm_type(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type {
356-
let args_capacity: usize = self.args.iter().map(|arg|
356+
// Ignore "extra" args from the call site for C variadic functions.
357+
// Only the "fixed" args are part of the LLVM function signature.
358+
let args = if self.c_variadic { &self.args[..self.fixed_count] } else { &self.args };
359+
360+
let args_capacity: usize = args.iter().map(|arg|
357361
if arg.pad.is_some() { 1 } else { 0 } +
358362
if let PassMode::Pair(_, _) = arg.mode { 2 } else { 1 }
359363
).sum();
@@ -371,7 +375,7 @@ impl<'tcx> FnAbiLlvmExt<'tcx> for FnAbi<'tcx, Ty<'tcx>> {
371375
}
372376
};
373377

374-
for arg in &self.args {
378+
for arg in args {
375379
// add padding
376380
if let Some(ty) = arg.pad {
377381
llargument_tys.push(ty.llvm_type(cx));

0 commit comments

Comments
 (0)
Please sign in to comment.