mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 07:59:27 +02:00
* avoid internalerror for dec/inc(...,v) with v>high(int64), resolves #35298
git-svn-id: trunk@44031 -
This commit is contained in:
parent
993144b91b
commit
6c71fd461d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -17904,6 +17904,7 @@ tests/webtbs/tw3523.pp svneol=native#text/plain
|
||||
tests/webtbs/tw35233.pp svneol=native#text/plain
|
||||
tests/webtbs/tw35272.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3529.pp svneol=native#text/plain
|
||||
tests/webtbs/tw35298.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3531.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3533.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3534.pp svneol=native#text/plain
|
||||
|
@ -451,7 +451,9 @@ implementation
|
||||
begin
|
||||
{$if not defined(cpu64bitalu) and not defined(cpuhighleveltarget)}
|
||||
if def_cgsize(left.resultdef) in [OS_64,OS_S64] then
|
||||
cg64.a_op64_const_loc(current_asmdata.CurrAsmList,addsubop[inlinenumber],def_cgsize(left.resultdef),addvalue,tcallparanode(left).left.location)
|
||||
{ use addvalue.svalue here to avoid an internal error if addvalue is unsigned and overflows int64, see #35298,
|
||||
we are only interested in the bit pattern here }
|
||||
cg64.a_op64_const_loc(current_asmdata.CurrAsmList,addsubop[inlinenumber],def_cgsize(left.resultdef),addvalue.svalue,tcallparanode(left).left.location)
|
||||
else
|
||||
{$endif not cpu64bitalu and not cpuhighleveltarget}
|
||||
hlcg.a_op_const_loc(current_asmdata.CurrAsmList,addsubop[inlinenumber],left.resultdef,
|
||||
|
16
tests/webtbs/tw35298.pp
Normal file
16
tests/webtbs/tw35298.pp
Normal file
@ -0,0 +1,16 @@
|
||||
{$MODE DELPHI}
|
||||
{$RANGECHECKS OFF}
|
||||
{$OVERFLOWCHECKS OFF}
|
||||
|
||||
function SplitMix64(var X: UInt64) : UInt64;
|
||||
var
|
||||
Z: UInt64;
|
||||
begin
|
||||
Inc(X, UInt64($9E3779B97F4A7C15));
|
||||
Z := (X xor (X shr 30)) * UInt64($BF58476D1CE4E5B9);
|
||||
Z := (Z xor (Z shr 27)) * UInt64($94D049BB133111EB);
|
||||
Result := Z xor (Z shr 31);
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user