Browse Source

* ttgobj.isstartoftemp now returns false in case it finds that the temp has been
freed. This prevents a compiler crash in tcgassignmentnode.maybechangetemp
when compiling packages/fcl-json/tests/testjson with -O2 on WebAssembly.

Nikolay Nikolov 1 week ago
parent
commit
17bb41f2ea
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/tgobj.pas

+ 5 - 1
compiler/tgobj.pas

@@ -708,13 +708,17 @@ implementation
          begin
          begin
            if (hp^.pos=ref.temppos.val) then
            if (hp^.pos=ref.temppos.val) then
             begin
             begin
+              if hp^.temptype=tt_free then
+                begin
+                  result:=false;
+                  exit;
+                end;
               temp_to_ref(hp, tmpref);
               temp_to_ref(hp, tmpref);
               result:=references_equal(ref, tmpref);
               result:=references_equal(ref, tmpref);
               exit;
               exit;
             end;
             end;
            hp:=hp^.next;
            hp:=hp^.next;
          end;
          end;
-        internalerror(2018042601);
       end;
       end;