Browse Source

* generate an internal error if an attempt is made to emit a
R_WASM_MEMORY_ADDR_LEB relocation, that points to code, instead of
data

Nikolay Nikolov 3 năm trước cách đây
mục cha
commit
efd5831742
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      compiler/ogwasm.pas

+ 2 - 0
compiler/ogwasm.pas

@@ -970,6 +970,8 @@ implementation
                       if not assigned(objrel.symbol) then
                         internalerror(2021092603);
                       Inc(relcount^);
+                      if IsExternalFunction(objrel.symbol) or (objrel.symbol.typ=AT_FUNCTION) then
+                        internalerror(2021092628);
                       WriteByte(relout,Ord(R_WASM_MEMORY_ADDR_LEB));
                       WriteUleb(relout,objrel.DataOffset+objsec.FileSectionOfs);
                       WriteUleb(relout,TWasmObjSymbol(objrel.symbol).SymbolIndex);