* more crash fixes

git-svn-id: trunk@9042 -
This commit is contained in:
florian 2007-11-01 14:52:22 +00:00
parent e62c6cfcc4
commit 7cea844223

View File

@ -471,6 +471,7 @@ begin
fillchar(p^,size,#255); fillchar(p^,size,#255);
{ retrieve backtrace info } { retrieve backtrace info }
bp:=get_caller_frame(get_frame); bp:=get_caller_frame(get_frame);
{ valid bp? } { valid bp? }
if (bp>=StackBottom) and (bp<(StackBottom + StackLength)) then if (bp>=StackBottom) and (bp<(StackBottom + StackLength)) then
for i:=1 to tracesize do for i:=1 to tracesize do
@ -479,8 +480,9 @@ begin
oldbp:=bp; oldbp:=bp;
bp:=get_caller_frame(bp); bp:=get_caller_frame(bp);
if (bp<oldbp) or (bp>(StackBottom + StackLength)) then if (bp<oldbp) or (bp>(StackBottom + StackLength)) then
bp:=nil; break;
end; end;
{ insert in the linked list } { insert in the linked list }
if loc_info^.heap_mem_root<>nil then if loc_info^.heap_mem_root<>nil then
loc_info^.heap_mem_root^.next:=pp; loc_info^.heap_mem_root^.next:=pp;
@ -572,10 +574,13 @@ begin
else else
begin begin
bp:=get_caller_frame(get_frame); bp:=get_caller_frame(get_frame);
if (bp>=StackBottom) and (bp<(StackBottom + StackLength)) then
for i:=(tracesize div 2)+1 to tracesize do for i:=(tracesize div 2)+1 to tracesize do
begin begin
pp^.calls[i]:=get_caller_addr(bp); pp^.calls[i]:=get_caller_addr(bp);
bp:=get_caller_frame(bp); bp:=get_caller_frame(bp);
if not((bp>=StackBottom) and (bp<(StackBottom + StackLength))) then
break;
end; end;
end; end;
inc(loc_info^.freemem_cnt); inc(loc_info^.freemem_cnt);
@ -852,13 +857,14 @@ begin
inc(loc_info^.getmem8_size,(size+7) and not 7); inc(loc_info^.getmem8_size,(size+7) and not 7);
{ generate new backtrace } { generate new backtrace }
bp:=get_caller_frame(get_frame); bp:=get_caller_frame(get_frame);
if (bp>=StackBottom) and (bp<(StackBottom + StackLength)) then
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; oldbp:=bp;
bp:=get_caller_frame(bp); bp:=get_caller_frame(bp);
if (bp<oldbp) or (bp>(StackBottom + StackLength)) then if (bp<oldbp) or (bp>(StackBottom + StackLength)) then
bp:=nil; break;
end; end;
{ regenerate signature } { regenerate signature }
if usecrc then if usecrc then