Browse Source

Merged revisions 7086 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r7086 | pierre | 2007-04-11 00:14:47 +0200 (Wed, 11 Apr 2007) | 3 lines

Patch from Vincent Snijders, sent to fpc-devel
add the same sanity check for the frame pointer
in TraceReAllocMem as already is in TraceGetMem.
........

git-svn-id: branches/fixes_2_2@7115 -

pierre 18 years ago
parent
commit
2248d7b836
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/inc/heaptrc.pp

+ 4 - 0
rtl/inc/heaptrc.pp

@@ -628,6 +628,7 @@ var
   allocsize,
   allocsize,
   movesize,
   movesize,
   i  : ptrint;
   i  : ptrint;
+  oldbp,
   bp : pointer;
   bp : pointer;
   pl : pdword;
   pl : pdword;
   pp : pheap_mem_info;
   pp : pheap_mem_info;
@@ -745,7 +746,10 @@ begin
   for i:=1 to tracesize do
   for i:=1 to tracesize do
    begin
    begin
      pp^.calls[i]:=get_caller_addr(bp);
      pp^.calls[i]:=get_caller_addr(bp);
+     oldbp:=bp;
      bp:=get_caller_frame(bp);
      bp:=get_caller_frame(bp);
+     if (bp<oldbp) or (bp>(StackBottom + StackLength)) then
+       bp:=nil;
    end;
    end;
   { regenerate signature }
   { regenerate signature }
   if usecrc then
   if usecrc then