Browse Source

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 years ago
parent
commit
be6bf6e3f7
1 changed files with 2 additions and 1 deletions
  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