Sfoglia il codice sorgente

* fixed handling of uninitialised complex function results

git-svn-id: trunk@33940 -
Jonas Maebe 9 anni fa
parent
commit
b76539a049
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      compiler/llvm/hlcgllvm.pas

+ 6 - 1
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: