diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-14 11:33:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-14 11:33:13 -0400 |
| commit | ed3181f029809f8cd608f2c20b60d1b7c6e353e3 (patch) | |
| tree | f0a9143d8c6a682e974768f0b095a159e8db9415 /src | |
| parent | 2a719ee6c598b7096060168a0e7c93ae3e244008 (diff) | |
| parent | f78d4ed30c1bd92fc5ecc26c2d5f11751b406255 (diff) | |
| download | zig-ed3181f029809f8cd608f2c20b60d1b7c6e353e3.tar.gz zig-ed3181f029809f8cd608f2c20b60d1b7c6e353e3.zip | |
Merge branch 'eduardosm-extern-return-small-struct'
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 3f54c120b4..0bcc211164 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -3166,6 +3166,10 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr return nullptr; } else if (first_arg_ret) { return instruction->tmp_ptr; + } else if (handle_is_ptr(src_return_type)) { + auto store_instr = LLVMBuildStore(g->builder, result, instruction->tmp_ptr); + LLVMSetAlignment(store_instr, LLVMGetAlignment(instruction->tmp_ptr)); + return instruction->tmp_ptr; } else { return result; } |
