Browse Source

Fix missing alignment call.

git-svn-id: branches/laksen/riscv_new@39523 -
Jeppe Johansen 7 years ago
parent
commit
f2670bc8fb
1 changed files with 6 additions and 4 deletions
  1. 6 4
      rtl/inc/dynarr.inc

+ 6 - 4
rtl/inc/dynarr.inc

@@ -820,7 +820,12 @@ function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Po
         a := PPointerArray(a)^[indices[i]];
 
       { skip kind and name }
-      typeInfo:=(typeInfo+2+PByte(typeInfo)[1]);
+{$ifdef VER3_0}
+      typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
+{$else VER3_0}
+      typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
+{$endif VER3_0}
+
       { store the last element size for the index calculation }
       elsize:=pdynarraytypedata(typeInfo)^.elSize;
       { element type info}
@@ -834,9 +839,6 @@ function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Po
         exit(nil);
     end;
 
-    { skip kind and name }
-    typeInfo:=(typeInfo+2+PByte(typeInfo)[1]);
-
     result:=@(PByte(a)[indices[h]*elsize]);
   end;