Ver código fonte

* check for codegenerror in twasmaddrnode.pass_typecheck and exit early, to avoid crashes

Nikolay Nikolov 2 anos atrás
pai
commit
84b60d3f00
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      compiler/wasm32/nwasmmem.pas

+ 4 - 0
compiler/wasm32/nwasmmem.pas

@@ -38,6 +38,7 @@ interface
 implementation
 
     uses
+      globals,
       verbose,
       symcpu;
 
@@ -46,6 +47,9 @@ implementation
     function twasmaddrnode.pass_typecheck: tnode;
     begin
       Result:=inherited;
+      if codegenerror then
+       exit;
+
       if is_wasm_externref(left.resultdef) then
         begin
           CGMessagePos(left.fileinfo,type_e_cannot_take_address_of_wasm_externref);