diff options
| author | Hans Kratz <hans@appfour.com> | 2021-08-03 05:11:17 +0000 |
|---|---|---|
| committer | Hans Kratz <hans@appfour.com> | 2021-08-04 23:51:19 +0200 |
| commit | 7dbc568325c929eeefc261532b034f904cf4d5b4 (patch) | |
| tree | b17a4345e59069bf48b7d5df40f313367db5d3d3 /compiler/rustc_codegen_llvm/src | |
| parent | 4a8202c4a68ec6161dbc31dcb5b0ec51d84c9d87 (diff) | |
| download | rust-7dbc568325c929eeefc261532b034f904cf4d5b4.tar.gz rust-7dbc568325c929eeefc261532b034f904cf4d5b4.zip | |
Fix va_args calling on aarch64 non-macos/ios.
emit_aapcs_va_arg() emits hardcoded field indexes to access the aarch64-specific `VaListImpl` struct. Due to the removed padding those indexes have changed.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/va_arg.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/va_arg.rs b/compiler/rustc_codegen_llvm/src/va_arg.rs index c9fb09570c3..4888f7f355f 100644 --- a/compiler/rustc_codegen_llvm/src/va_arg.rs +++ b/compiler/rustc_codegen_llvm/src/va_arg.rs @@ -110,13 +110,13 @@ fn emit_aapcs_va_arg( let gr_type = target_ty.is_any_ptr() || target_ty.is_integral(); let (reg_off, reg_top_index, slot_size) = if gr_type { - let gr_offs = bx.struct_gep(va_list_ty, va_list_addr, 7); + let gr_offs = bx.struct_gep(va_list_ty, va_list_addr, 3); let nreg = (layout.size.bytes() + 7) / 8; - (gr_offs, 3, nreg * 8) + (gr_offs, 1, nreg * 8) } else { - let vr_off = bx.struct_gep(va_list_ty, va_list_addr, 9); + let vr_off = bx.struct_gep(va_list_ty, va_list_addr, 4); let nreg = (layout.size.bytes() + 15) / 16; - (vr_off, 5, nreg * 16) + (vr_off, 2, nreg * 16) }; // if the offset >= 0 then the value will be on the stack |
