From 9a119390041862c5382ccbbfca44d1f7e1162ea7 Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 14 Dec 2019 15:56:26 +0000 Subject: [PATCH] FpDebug: Fix range check (addresses in target are allowed to overflow) git-svn-id: trunk@62386 - --- components/fpdebug/fpdbgclasses.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/fpdebug/fpdbgclasses.pp b/components/fpdebug/fpdbgclasses.pp index ac397375ad..51492e3a7e 100644 --- a/components/fpdebug/fpdbgclasses.pp +++ b/components/fpdebug/fpdbgclasses.pp @@ -2284,13 +2284,17 @@ begin LastFrameBase := FrameBase; if OutSideFrame then begin if not Process.ReadData(StackPtr, Size, Address) or (Address = 0) then Break; + {$PUSH}{$R-}{$Q-} StackPtr := StackPtr + 1 * Size; // After popping return-addr from "StackPtr" LastFrameBase := LastFrameBase - 1; // Make the loop think thas LastFrameBase was smaller + {$POP} // last stack has no frame //AnEntry.RegisterValueList.DbgRegisterAutoCreate[nBP].SetValue(0, '0',Size, BP); end else begin + {$PUSH}{$R-}{$Q-} StackPtr := FrameBase + 2 * Size; // After popping return-addr from "FrameBase + Size" + {$POP} if not Process.ReadData(FrameBase + Size, Size, Address) or (Address = 0) then Break; if not Process.ReadData(FrameBase, Size, FrameBase) then Break; end;