|
@@ -2222,7 +2222,8 @@ implementation
|
|
CodeSectionRead: Boolean = false;
|
|
CodeSectionRead: Boolean = false;
|
|
DataCountSectionRead: Boolean = false;
|
|
DataCountSectionRead: Boolean = false;
|
|
|
|
|
|
- DataCount: uint32;
|
|
|
|
|
|
+ DataSegments: array of record
|
|
|
|
+ end;
|
|
|
|
|
|
function ReadCustomSection: Boolean;
|
|
function ReadCustomSection: Boolean;
|
|
|
|
|
|
@@ -2245,7 +2246,7 @@ implementation
|
|
Result:=False;
|
|
Result:=False;
|
|
if SegmentInfoSectionRead then
|
|
if SegmentInfoSectionRead then
|
|
begin
|
|
begin
|
|
- InputError('The WASM_SEGMENT_INFO section is duplicated');
|
|
|
|
|
|
+ InputError('The WASM_SEGMENT_INFO subsection is duplicated');
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
SegmentInfoSectionRead:=True;
|
|
SegmentInfoSectionRead:=True;
|
|
@@ -2735,7 +2736,7 @@ implementation
|
|
|
|
|
|
function ReadDataCountSection: Boolean;
|
|
function ReadDataCountSection: Boolean;
|
|
var
|
|
var
|
|
- v: uint32;
|
|
|
|
|
|
+ DataCount: uint32;
|
|
begin
|
|
begin
|
|
Result:=False;
|
|
Result:=False;
|
|
if DataCountSectionRead then
|
|
if DataCountSectionRead then
|
|
@@ -2744,17 +2745,17 @@ implementation
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
DataCountSectionRead:=True;
|
|
DataCountSectionRead:=True;
|
|
- if not ReadUleb32(v) then
|
|
|
|
|
|
+ if not ReadUleb32(DataCount) then
|
|
begin
|
|
begin
|
|
InputError('Error reading the data count from the data count section');
|
|
InputError('Error reading the data count from the data count section');
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
- DataCount:=v;
|
|
|
|
if AReader.Pos<>(SectionStart+SectionSize) then
|
|
if AReader.Pos<>(SectionStart+SectionSize) then
|
|
begin
|
|
begin
|
|
InputError('Unexpected data count section size');
|
|
InputError('Unexpected data count section size');
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
+ SetLength(DataSegments, DataCount);
|
|
Result:=true;
|
|
Result:=true;
|
|
end;
|
|
end;
|
|
|
|
|