mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-18 09:29:14 +02:00
+ read the data count from the data section. Set size of the DataSegments
array, if the data count section hasn't been encountered. Compare the count with the value from the data count section, in case the data count section has been encountered, and issue an error, if they differ.
This commit is contained in:
parent
10b201c506
commit
e4600f5e38
@ -2731,6 +2731,8 @@ implementation
|
||||
end;
|
||||
|
||||
function ReadDataSection: Boolean;
|
||||
var
|
||||
DataCount: uint32;
|
||||
begin
|
||||
Result:=False;
|
||||
if DataSectionRead then
|
||||
@ -2739,6 +2741,21 @@ implementation
|
||||
exit;
|
||||
end;
|
||||
DataSectionRead:=True;
|
||||
if not ReadUleb32(DataCount) then
|
||||
begin
|
||||
InputError('Error reading the data entries count from the data section');
|
||||
exit;
|
||||
end;
|
||||
if DataCountSectionRead then
|
||||
begin
|
||||
if Length(DataSegments)<>DataCount then
|
||||
begin
|
||||
InputError('Data entries count in the data section do not match the number, specified in the data count section');
|
||||
exit
|
||||
end;
|
||||
end
|
||||
else
|
||||
SetLength(DataSegments,DataCount);
|
||||
end;
|
||||
|
||||
function ReadDataCountSection: Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user