瀏覽代碼

+ report an error in case a wasm object file has a code section, without a main symbol

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

+ 5 - 0
compiler/ogwasm.pas

@@ -3791,6 +3791,11 @@ implementation
         for i:=low(CodeSegments) to high(CodeSegments) do
         for i:=low(CodeSegments) to high(CodeSegments) do
           with CodeSegments[i] do
           with CodeSegments[i] do
             begin
             begin
+              if SegName='' then
+                begin
+                  InputError('Code section ' + tostr(i) + ' does not have a main symbol defined in the symbol table');
+                  exit;
+                end;
               if SegIsExported then
               if SegIsExported then
                 CurrSec:=ObjData.createsection(SegName,1,[oso_executable,oso_Data,oso_load,oso_keep],false)
                 CurrSec:=ObjData.createsection(SegName,1,[oso_executable,oso_Data,oso_load,oso_keep],false)
               else
               else