diff options
author | pierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-04-30 09:55:11 +0000 |
---|---|---|
committer | pierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-04-30 09:55:11 +0000 |
commit | 88d88de52edb3a2652a83e6e2bcfa422dddfa0bf (patch) | |
tree | a982bcfb818256f7492221bb4c0f9beb597d6850 | |
parent | f793225f46c0771d3dd851510e0cb93b10415b32 (diff) | |
download | fpc-88d88de52edb3a2652a83e6e2bcfa422dddfa0bf.tar.gz |
Avoid range/overflow error after commit #49290
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49298 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/aarch64/ncpumat.pas | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/aarch64/ncpumat.pas b/compiler/aarch64/ncpumat.pas index 6395a7f009..e2c22435c7 100644 --- a/compiler/aarch64/ncpumat.pas +++ b/compiler/aarch64/ncpumat.pas @@ -337,8 +337,8 @@ implementation else begin calc_divconst_magic_unsigned(resultdef.size * 8, tordconstnode(right).value, reciprocal, magic_add, shift); - cg.a_load_const_reg(current_asmdata.CurrAsmList, opsize, reciprocal, resultreg); - + { Add explicit typecast to tcgint type, to avoid range or overflow check } + cg.a_load_const_reg(current_asmdata.CurrAsmList, opsize, tcgint(reciprocal), resultreg); { UMULH is only available for the full 64-bit registers } if opsize in [OS_64, OS_S64] then begin |