Jelajahi Sumber

* fix r7009, check also if the other node is integer type

git-svn-id: trunk@7032 -
peter 18 tahun lalu
induk
melakukan
bc071f709c
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      compiler/nadd.pas

+ 2 - 2
compiler/nadd.pas

@@ -385,7 +385,7 @@ implementation
           end;
 
         { Add,Sub,Mul with constant 0 or 1?  }
-        if is_constintnode(right) then
+        if is_constintnode(right) and is_integer(left.resultdef) then
           begin
             if tordconstnode(right).value = 0 then
               begin
@@ -406,7 +406,7 @@ implementation
             if assigned(result) then
               exit;
           end;
-        if is_constintnode(left) then
+        if is_constintnode(left) and is_integer(right.resultdef) then
           begin
             if tordconstnode(left).value = 0 then
               begin