* changed allocating a temp with type sinttype and size sinttype*dims for

with a ctemprefnode.create_offset() hack into a proper array, because
    the old way does not work at all with LLVM (and is ugly)

git-svn-id: trunk@33724 -
This commit is contained in:
Jonas Maebe 2016-05-20 20:51:38 +00:00
parent ffe4e7fada
commit abe8d44f37

View File

@ -3958,7 +3958,7 @@ implementation
newblock:=internalstatements(newstatement);
{ get temp for array of lengths }
temp:=ctempcreatenode.create(sinttype,dims*sinttype.size,tt_persistent,false);
temp:=ctempcreatenode.create(carraydef.getreusable(sinttype,dims),dims*sinttype.size,tt_persistent,false);
addstatement(newstatement,temp);
{ load array of lengths }
@ -3967,7 +3967,10 @@ implementation
while assigned(ppn.right) do
begin
addstatement(newstatement,cassignmentnode.create(
ctemprefnode.create_offset(temp,counter*sinttype.size),
cvecnode.create(
ctemprefnode.create(temp),
genintconstnode(counter)
),
ppn.left));
ppn.left:=nil;
dec(counter);
@ -3977,8 +3980,11 @@ implementation
ppn.left:=nil;
{ create call to fpc_dynarr_setlength }
npara:=ccallparanode.create(caddrnode.create_internal
(ctemprefnode.create(temp)),
npara:=ccallparanode.create(caddrnode.create_internal(
cvecnode.create(
ctemprefnode.create(temp),
genintconstnode(0)
)),
ccallparanode.create(cordconstnode.create
(dims,sinttype,true),
ccallparanode.create(caddrnode.create_internal