Browse Source

+ added check for the ExeFunctionIndex inside WriteCodeSegments

Nikolay Nikolov 1 year ago
parent
commit
507e9eb20a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compiler/ogwasm.pas

+ 2 - 0
compiler/ogwasm.pas

@@ -4091,6 +4091,8 @@ implementation
                 internalerror(2023123104);
               if not assigned(objsec.data) then
                 internalerror(2023123105);
+              if objsec.MainFuncSymbol.LinkingData.ExeFunctionIndex<>(i+Length(FFunctionImports)) then
+                internalerror(2024010101);
               WriteUleb(FWasmSections[wsiFunction],objsec.MainFuncSymbol.LinkingData.ExeTypeIndex);
               WriteUleb(FWasmSections[wsiCode],objsec.Data.size);
               objsec.Data.seek(0);