浏览代码

Fix overflow when value is high(int64) in OptPass1And method

git-svn-id: trunk@45734 -
pierre 5 年之前
父节点
当前提交
ec3fe2f990
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/armgen/aoptarm.pas

+ 2 - 1
compiler/armgen/aoptarm.pas

@@ -940,7 +940,8 @@ Implementation
             remove either the and or the lsl/xsr sequence if possible
           }
 
-          else if cutils.ispowerof2(taicpu(p).oper[2]^.val+1,i) and
+          else if (taicpu(p).oper[2]^.val < high(int64)) and 
+	    cutils.ispowerof2(taicpu(p).oper[2]^.val+1,i) and
             GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
             MatchInstruction(hp1, A_MOV, [taicpu(p).condition], [PF_None]) and
             (taicpu(hp1).ops=3) and