瀏覽代碼

+ added check for the ExeFunctionIndex inside WriteCodeSegments

Nikolay Nikolov 1 年之前
父節點
當前提交
507e9eb20a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      compiler/ogwasm.pas

+ 2 - 0
compiler/ogwasm.pas

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