瀏覽代碼

Avoid wrong typecast by adding check that p1 is an instuction before casting it to taicpu

Pierre Muller 1 年之前
父節點
當前提交
53bf5dc6ef
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      compiler/arm/aoptcpu.pas

+ 1 - 1
compiler/arm/aoptcpu.pas

@@ -2453,7 +2453,7 @@ Implementation
         Result:=true
       else
         begin
-          if SuperRegistersEqual(Reg, NR_DEFAULTFLAGS) then
+          if SuperRegistersEqual(Reg, NR_DEFAULTFLAGS) and (p1.typ = ait_instruction) then
             begin
               { Conditional instruction reads CPSR register }
               if (taicpu(p1).condition <> C_None) then