Browse Source

+ check and report an error if a passive data segment is encountered by the wasm object reader

Nikolay Nikolov 1 year ago
parent
commit
fc7ed302e7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      compiler/ogwasm.pas

+ 5 - 0
compiler/ogwasm.pas

@@ -2890,6 +2890,11 @@ implementation
                       InputError('Memory index other than 0 not supported (got ' + tostr(MemIdx) + ')');
                       InputError('Memory index other than 0 not supported (got ' + tostr(MemIdx) + ')');
                       exit;
                       exit;
                     end;
                     end;
+                  if not Active then
+                    begin
+                      InputError('Passive memory segments not supported');
+                      exit;
+                    end;
                   if not ReadUleb32(Len) then
                   if not ReadUleb32(Len) then
                     begin
                     begin
                       InputError('Error reading data segment length');
                       InputError('Error reading data segment length');