From b3c254d629f715ea6cc225509df14736c2152365 Mon Sep 17 00:00:00 2001 From: kalsprite Date: Mon, 10 Aug 2026 21:48:10 -0700 Subject: [PATCH] i386: pass aggregate arguments by value on the stack --- src/llvm_abi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 528ddca88..3d4af355d 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -437,7 +437,9 @@ namespace lbAbi386 { if (sz == 0) { args[i] = lb_arg_type_ignore(t); } else { - args[i] = lb_arg_type_indirect(t, nullptr); + // Aggregates are pushed onto the stack by value, not passed as a pointer + // to a caller-owned copy. This is the rule for both i386 targets. + args[i] = lb_arg_type_indirect_byval(c, t); } } else { args[i] = non_struct(c, t, false);