Browse Source

* fixed crash in r30244 (we only have to get a new elementdef if we didn't
already initialise the location, and we won't get a new elementdef if
the location is already assigned)

git-svn-id: branches/hlcgllvm@30346 -

Jonas Maebe 10 years ago
parent
commit
5a2609933f
1 changed files with 6 additions and 3 deletions
  1. 6 3
      compiler/llvm/nllvmmem.pas

+ 6 - 3
compiler/llvm/nllvmmem.pas

@@ -155,9 +155,12 @@ implementation
       if (resultdef.typ=floatdef) and
          (tfloatdef(resultdef).floattype=s80real) then
        begin
-         { avoid uninitialised warning }
-         arrptrelementdef:=nil;
-         getarrelementptrdef;
+         if not assigned(locref) then
+           begin
+             { avoid uninitialised warning }
+             arrptrelementdef:=nil;
+             getarrelementptrdef;
+           end;
          hreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,getpointerdef(resultdef));
          hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,arrptrelementdef,getpointerdef(resultdef),locref^.base,hreg);
          locref^.base:=hreg;