mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 07:59:09 +02:00
* fixed the writing of the external functions in the import table
This commit is contained in:
parent
54481d7218
commit
72a49b68ce
@ -314,7 +314,7 @@ implementation
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
i:=AddFuncType(ft.functype);
|
i:=AddFuncType(ft.functype);
|
||||||
FFuncTypeNames.Add(ft.funcname, @(FFuncTypes[i]));
|
FFuncTypeNames.Add(ft.funcname, Pointer(i+1));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
@ -443,7 +443,7 @@ implementation
|
|||||||
|
|
||||||
function TWasmObjOutput.IsExternalFunction(sym: TObjSymbol): Boolean;
|
function TWasmObjOutput.IsExternalFunction(sym: TObjSymbol): Boolean;
|
||||||
begin
|
begin
|
||||||
result:=(sym.bind=AB_EXTERNAL) and (TWasmObjData(sym.ObjData).FFuncTypeNames.Find(sym.Name)<>nil);
|
result:=(sym.bind=AB_EXTERNAL) and (TWasmObjData(sym.ObjData).FFuncTypeNames.FindIndexOf(sym.Name)<>-1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWasmObjOutput.writeData(Data:TObjData):boolean;
|
function TWasmObjOutput.writeData(Data:TObjData):boolean;
|
||||||
@ -536,7 +536,7 @@ implementation
|
|||||||
WriteName(FWasmSections[wsiImport],'env');
|
WriteName(FWasmSections[wsiImport],'env');
|
||||||
WriteName(FWasmSections[wsiImport],objsym.Name);
|
WriteName(FWasmSections[wsiImport],objsym.Name);
|
||||||
WriteByte(FWasmSections[wsiImport],$00); { func }
|
WriteByte(FWasmSections[wsiImport],$00); { func }
|
||||||
WriteUleb(FWasmSections[wsiImport],PWasmFuncType(TWasmObjData(Data).FFuncTypeNames.Find(objsym.Name))-PWasmFuncType(TWasmObjData(Data).FFuncTypes[0]));
|
WriteUleb(FWasmSections[wsiImport],PtrUInt(TWasmObjData(Data).FFuncTypeNames.Find(objsym.Name))-1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ import[imports_count-1] }
|
{ import[imports_count-1] }
|
||||||
|
Loading…
Reference in New Issue
Block a user