diff options
author | laksen <laksen@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2018-07-29 14:18:19 +0000 |
---|---|---|
committer | laksen <laksen@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2018-07-29 14:18:19 +0000 |
commit | 3027d70df94a75532bf5519c7a602b2d2cd5675a (patch) | |
tree | ad7a561dc441a2d52d79fffa20787217ecd2a3bb | |
parent | f644e76169c6e9fd07bfedfc92602b4fe998ef47 (diff) | |
download | fpc-3027d70df94a75532bf5519c7a602b2d2cd5675a.tar.gz |
Fix missing alignment call.
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/laksen@39523 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | riscv_new/rtl/inc/dynarr.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/riscv_new/rtl/inc/dynarr.inc b/riscv_new/rtl/inc/dynarr.inc index 1ac9e5b023..cb64142ba1 100644 --- a/riscv_new/rtl/inc/dynarr.inc +++ b/riscv_new/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; |