2
0
Эх сурвалжийг харах

* patch by Rika: Don’t pretend optinfo^.index can be aword(−1), resolves #40405

florian 1 жил өмнө
parent
commit
bcf320a76e

+ 1 - 1
compiler/optbase.pas

@@ -35,7 +35,7 @@ unit optbase;
       PDFASet = ^TDFASet;
 
       toptinfo = record
-        { index of the current node inside the dfa sets, aword(-1) if no entry }
+        { index of the current node inside the dfa sets }
         index : aword;
         { dfa }
         def : tdfaset;

+ 0 - 1
compiler/optdeadstore.pas

@@ -59,7 +59,6 @@ unit optdeadstore;
 
                 { we need to have dfa for the node }
                 if assigned(a.left.optinfo) and
-                   (a.left.optinfo^.index<>aword(-1)) and
                    { node must be either a local or parameter load node }
                    (a.left.nodetype=loadn) and
                    { its address cannot have escaped the current routine }

+ 4 - 5
compiler/optdfa.pas

@@ -188,12 +188,11 @@ unit optdfa;
           life info for the node
         }
         procedure updatelifeinfo(n : tnode;const l : TDFASet);
-          var
-            b : boolean;
           begin
-            b:=DFASetNotEqual(l,n.optinfo^.life);
+            if not DFASetNotEqual(l,n.optinfo^.life) then
+              exit;
 {$ifdef DEBUG_DFA}
-            if not(changed) and b then
+            if not(changed) then
               begin
                 writeln('Another DFA pass caused by: ',nodetype2str[n.nodetype],'(',n.fileinfo.line,',',n.fileinfo.column,')');
                 write('  Life info set was:     ');PrintDFASet(Output,n.optinfo^.life);writeln;
@@ -201,7 +200,7 @@ unit optdfa;
               end;
 {$endif DEBUG_DFA}
 
-            changed:=changed or b;
+            changed:=true;
             n.optinfo^.life:=l;
           end;