From b76539a049598e517b71302305a75a567c6a3668 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 9 Jun 2016 22:00:05 +0000 Subject: [PATCH] * fixed handling of uninitialised complex function results git-svn-id: trunk@33940 - --- compiler/llvm/hlcgllvm.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/llvm/hlcgllvm.pas b/compiler/llvm/hlcgllvm.pas index 6d13f03b53..b54e56e571 100644 --- a/compiler/llvm/hlcgllvm.pas +++ b/compiler/llvm/hlcgllvm.pas @@ -1244,7 +1244,12 @@ implementation LOC_FPUREGISTER, LOC_MMREGISTER: begin - list.concat(taillvm.op_reg_size_undef(la_bitcast,resloc.location^.register,llvmgetcgparadef(resloc,true))); + if not llvmaggregatetype(resdef) then + list.concat(taillvm.op_reg_size_undef(la_bitcast,resloc.location^.register,llvmgetcgparadef(resloc,true))) + else + { bitcast doesn't work for aggregates -> just load from the + (uninitialised) function result memory location } + gen_load_loc_function_result(list,resdef,tabstractnormalvarsym(pd.funcretsym).localloc) end; { for empty record returns } LOC_VOID: