From be6bf6e3f74014b311046eff1aa13af92571fa9c Mon Sep 17 00:00:00 2001 From: masta Date: Sun, 22 Jul 2012 18:06:08 +0000 Subject: [PATCH] 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 - --- compiler/arm/aoptcpu.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/arm/aoptcpu.pas b/compiler/arm/aoptcpu.pas index 66fa611b20..3625d34fb2 100644 --- a/compiler/arm/aoptcpu.pas +++ b/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