瀏覽代碼

Fix possible access violation introduces in r21885

r21885 added a new peephole optimizer. The associated code refactoring
missed a check for

  tai(hp1).typ = tai_instruction

Which can lead to an access violation later on, because the rest of the
code expects to find a taicpu in hp1.

git-svn-id: trunk@21949 -
masta 13 年之前
父節點
當前提交
be6bf6e3f7
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/arm/aoptcpu.pas

+ 2 - 1
compiler/arm/aoptcpu.pas

@@ -511,7 +511,8 @@ Implementation
                       ....
                     }
                     if (taicpu(p).ops = 2) and
-                       GetNextInstruction(p,hp1) then
+                       GetNextInstruction(p,hp1) and
+                       (tai(hp1).typ = ait_instruction) then
                       begin
                         {
                           This changes the very common