浏览代码

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

git-svn-id: trunk@7032 -
peter 18 年之前
父节点
当前提交
bc071f709c
共有 1 个文件被更改,包括 2 次插入2 次删除
  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