aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-04-25 12:31:56 +0100
committerGitHub <noreply@github.com>2024-04-25 12:31:56 +0100
commit1ea353dbf7285071e93da2f5f9f2b2257ca6ca88 (patch)
tree3fbfb096ebf44ba4ab26b561617f5f473dcfc4cb /src
parente3d41f0a9ed106a0f0342fe8b166790965beb1b2 (diff)
parente8c5bb46296f8eb65fe8f343407381e88ba9bcca (diff)
Merge pull request #3479 from laytan/support-0-sized-return-arm64-abi
compiler: support returning 0 sized types in arm64 abi
Diffstat (limited to 'src')
-rw-r--r--src/llvm_abi.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 88bb58c55..85a16d321 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -1131,8 +1131,9 @@ namespace lbAbiArm64 {
if (size <= 16) {
LLVMTypeRef cast_type = nullptr;
- GB_ASSERT(size > 0);
- if (size <= 8) {
+ if (size == 0) {
+ cast_type = LLVMStructTypeInContext(c, nullptr, 0, false);
+ } else if (size <= 8) {
cast_type = LLVMIntTypeInContext(c, cast(unsigned)(size*8));
} else {
unsigned count = cast(unsigned)((size+7)/8);