Browse Source

Use correct class typecast for commit ba4cee279b

Pierre Muller 2 years ago
parent
commit
1a19fe1f03
1 changed files with 4 additions and 4 deletions
  1. 4 4
      compiler/nadd.pas

+ 4 - 4
compiler/nadd.pas

@@ -959,12 +959,12 @@ implementation
           end;
           end;
 
 
         { convert n - n mod const into n div const*const }
         { convert n - n mod const into n div const*const }
-        if (nodetype=subn) and (right.nodetype=modn) and is_constintnode(taddnode(right).right) and
-          (left.isequal(taddnode(right).left)) and not(might_have_sideeffects(left)) then
+        if (nodetype=subn) and (right.nodetype=modn) and is_constintnode(tmoddivnode(right).right) and
+          (left.isequal(tmoddivnode(right).left)) and not(might_have_sideeffects(left)) then
           begin
           begin
-            result:=caddnode.create_internal(muln,cmoddivnode.create(divn,left,taddnode(right).right.getcopy),taddnode(right).right);
+            result:=caddnode.create_internal(muln,cmoddivnode.create(divn,left,tmoddivnode(right).right.getcopy),tmoddivnode(right).right);
             left:=nil;
             left:=nil;
-            taddnode(right).right:=nil;
+            tmoddivnode(right).right:=nil;
             exit;
             exit;
           end;
           end;