mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-21 23:21:39 +02:00
rtl: fix possible division by zero
git-svn-id: trunk@24472 -
This commit is contained in:
parent
980bc634b4
commit
72fd58d62e
@ -115,6 +115,9 @@ var
|
||||
begin
|
||||
typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
||||
Count:=PArrayInfo(typeInfo)^.ElCount;
|
||||
{ no elements to process => exit }
|
||||
if Count = 0 then
|
||||
Exit;
|
||||
ElSize:=PArrayInfo(typeInfo)^.Size div Count;
|
||||
Info:=PArrayInfo(typeInfo)^.ElInfo;
|
||||
{ Process elements }
|
||||
@ -262,6 +265,9 @@ begin
|
||||
{$else}
|
||||
Result:=PArrayInfo(Temp)^.Size;
|
||||
Count:=PArrayInfo(Temp)^.ElCount;
|
||||
{ no elements to process => exit }
|
||||
if Count = 0 then
|
||||
Exit;
|
||||
Info:=PArrayInfo(Temp)^.ElInfo;
|
||||
copiedsize:=Result div Count;
|
||||
Offset:=0;
|
||||
|
Loading…
Reference in New Issue
Block a user