浏览代码

Check that tai returned by GetNextInstruction is really a taicpu object before using an explicit typecast

Pierre Muller 1 年之前
父节点
当前提交
d53af12a6d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      compiler/x86/aoptx86.pas

+ 1 - 1
compiler/x86/aoptx86.pas

@@ -4535,7 +4535,7 @@ unit aoptx86;
                       end
                     else if (taicpu(hp2).oper[0]^.typ = top_ref) and
                       GetNextInstruction(hp2, hp4) and
-                      (taicpu(hp4).opcode = A_MOV) then
+                      (hp4 is taicpu) and (taicpu(hp4).opcode = A_MOV) then
                       { Optimise the following first:
                           movl [mem1],reg1
                           movl [mem1],reg2