mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 05:29:40 +02:00
+ wasm internal object reader: record section indices for debug sections. Check for duplicated debug sections.
This commit is contained in:
parent
f510e6f59b
commit
dfdc4a4d78
@ -2374,6 +2374,7 @@ implementation
|
||||
|
||||
CodeSectionIndex: Integer = -1;
|
||||
DataSectionIndex: Integer = -1;
|
||||
DebugSectionIndex: array [TWasmCustomDebugSectionType] of Integer = (-1,-1,-1,-1,-1,-1,-1);
|
||||
|
||||
FuncTypes: array of record
|
||||
IsImport: Boolean;
|
||||
@ -2895,6 +2896,13 @@ implementation
|
||||
var
|
||||
ObjSec: TObjSection;
|
||||
begin
|
||||
Result:=False;
|
||||
if DebugSectionIndex[SectionType]<>-1 then
|
||||
begin
|
||||
InputError('Duplicated debug section: ' + SectionName);
|
||||
exit;
|
||||
end;
|
||||
DebugSectionIndex[SectionType]:=SectionIndex;
|
||||
ObjSec:=ObjData.createsection(SectionName,1,[oso_Data,oso_debug],false);
|
||||
ObjSec.DataPos:=AReader.Pos;
|
||||
ObjSec.Size:=SectionStart+SectionSize-AReader.Pos;
|
||||
|
Loading…
Reference in New Issue
Block a user