瀏覽代碼

+ check for memory index other than 0 in the wasm object reader and report an error, since that is not supported

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

+ 5 - 0
compiler/ogwasm.pas

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