Browse Source

+ symbol table subsection duplicate check

Nikolay Nikolov 1 year ago
parent
commit
272db1b872
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/ogwasm.pas

+ 7 - 0
compiler/ogwasm.pas

@@ -2162,6 +2162,7 @@ implementation
         DataCountSectionRead: Boolean = false;
 
         SegmentInfoSectionRead: Boolean = false;
+        SymbolTableSectionRead: Boolean = false;
 
         DataSegments: array of record
           Active: Boolean;
@@ -2346,6 +2347,12 @@ implementation
             function ReadSymbolTable: Boolean;
               begin
                 Result:=False;
+                if SymbolTableSectionRead then
+                  begin
+                    InputError('The WASM_SYMBOL_TABLE subsection is duplicated');
+                    exit;
+                  end;
+                SymbolTableSectionRead:=True;
               end;
 
             const