mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 18:29:13 +02:00
- Killed 'goto'.
git-svn-id: trunk@27096 -
This commit is contained in:
parent
d440a05301
commit
3b5552ae75
@ -23,7 +23,6 @@ interface
|
|||||||
{$endif FPC_HEAPTRC_EXTRA}
|
{$endif FPC_HEAPTRC_EXTRA}
|
||||||
|
|
||||||
{$checkpointer off}
|
{$checkpointer off}
|
||||||
{$goto on}
|
|
||||||
{$TYPEDADDRESS on}
|
{$TYPEDADDRESS on}
|
||||||
|
|
||||||
{$if defined(win32) or defined(wince)}
|
{$if defined(win32) or defined(wince)}
|
||||||
@ -1013,8 +1012,6 @@ var
|
|||||||
bp : pointer;
|
bp : pointer;
|
||||||
pcaddr : codepointer;
|
pcaddr : codepointer;
|
||||||
ptext : ^text;
|
ptext : ^text;
|
||||||
label
|
|
||||||
_exit;
|
|
||||||
begin
|
begin
|
||||||
if p=nil then
|
if p=nil then
|
||||||
runerror(204);
|
runerror(204);
|
||||||
@ -1037,11 +1034,11 @@ begin
|
|||||||
stack_top:=__stkbottom+__stklen;
|
stack_top:=__stkbottom+__stklen;
|
||||||
{ allow all between start of code and end of bss }
|
{ allow all between start of code and end of bss }
|
||||||
if ptruint(p)<=bss_end then
|
if ptruint(p)<=bss_end then
|
||||||
goto _exit;
|
exit;
|
||||||
{ stack can be above heap !! }
|
{ stack can be above heap !! }
|
||||||
|
|
||||||
if (ptruint(p)>=get_ebp) and (ptruint(p)<=stack_top) then
|
if (ptruint(p)>=get_ebp) and (ptruint(p)<=stack_top) then
|
||||||
goto _exit;
|
exit;
|
||||||
{$endif go32v2}
|
{$endif go32v2}
|
||||||
|
|
||||||
{ I don't know where the stack is in other OS !! }
|
{ I don't know where the stack is in other OS !! }
|
||||||
@ -1049,21 +1046,21 @@ begin
|
|||||||
{ inside stack ? }
|
{ inside stack ? }
|
||||||
if (ptruint(p)>ptruint(get_frame)) and
|
if (ptruint(p)>ptruint(get_frame)) and
|
||||||
(p<StackTop) then
|
(p<StackTop) then
|
||||||
goto _exit;
|
exit;
|
||||||
{ inside data ? }
|
{ inside data ? }
|
||||||
if (ptruint(p)>=ptruint(@sdata)) and (ptruint(p)<ptruint(@edata)) then
|
if (ptruint(p)>=ptruint(@sdata)) and (ptruint(p)<ptruint(@edata)) then
|
||||||
goto _exit;
|
exit;
|
||||||
|
|
||||||
{ inside bss ? }
|
{ inside bss ? }
|
||||||
if (ptruint(p)>=ptruint(@sbss)) and (ptruint(p)<ptruint(@ebss)) then
|
if (ptruint(p)>=ptruint(@sbss)) and (ptruint(p)<ptruint(@ebss)) then
|
||||||
goto _exit;
|
exit;
|
||||||
{ is program multi-threaded and p inside Threadvar range? }
|
{ is program multi-threaded and p inside Threadvar range? }
|
||||||
if TlsKey<>-1 then
|
if TlsKey<>-1 then
|
||||||
begin
|
begin
|
||||||
datap:=TlsGetValue(tlskey);
|
datap:=TlsGetValue(tlskey);
|
||||||
if ((ptruint(p)>=ptruint(datap)) and
|
if ((ptruint(p)>=ptruint(datap)) and
|
||||||
(ptruint(p)<ptruint(datap)+TlsSize)) then
|
(ptruint(p)<ptruint(datap)+TlsSize)) then
|
||||||
goto _exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{$endif windows}
|
{$endif windows}
|
||||||
|
|
||||||
@ -1071,27 +1068,27 @@ begin
|
|||||||
{ inside stack ? }
|
{ inside stack ? }
|
||||||
if (PtrUInt (P) > PtrUInt (Get_Frame)) and
|
if (PtrUInt (P) > PtrUInt (Get_Frame)) and
|
||||||
(PtrUInt (P) < PtrUInt (StackTop)) then
|
(PtrUInt (P) < PtrUInt (StackTop)) then
|
||||||
goto _exit;
|
exit;
|
||||||
{ inside data or bss ? }
|
{ inside data or bss ? }
|
||||||
if (PtrUInt (P) >= PtrUInt (@etext)) and (PtrUInt (P) < PtrUInt (@eend)) then
|
if (PtrUInt (P) >= PtrUInt (@etext)) and (PtrUInt (P) < PtrUInt (@eend)) then
|
||||||
goto _exit;
|
exit;
|
||||||
{$ENDIF OS2}
|
{$ENDIF OS2}
|
||||||
|
|
||||||
{$ifdef linux}
|
{$ifdef linux}
|
||||||
{ inside stack ? }
|
{ inside stack ? }
|
||||||
if (ptruint(p)>ptruint(get_frame)) and
|
if (ptruint(p)>ptruint(get_frame)) and
|
||||||
(ptruint(p)<$c0000000) then //todo: 64bit!
|
(ptruint(p)<$c0000000) then //todo: 64bit!
|
||||||
goto _exit;
|
exit;
|
||||||
{ inside data or bss ? }
|
{ inside data or bss ? }
|
||||||
if (ptruint(p)>=ptruint(@etext)) and (ptruint(p)<ptruint(@eend)) then
|
if (ptruint(p)>=ptruint(@etext)) and (ptruint(p)<ptruint(@eend)) then
|
||||||
goto _exit;
|
exit;
|
||||||
{$endif linux}
|
{$endif linux}
|
||||||
|
|
||||||
{$ifdef morphos}
|
{$ifdef morphos}
|
||||||
{ inside stack ? }
|
{ inside stack ? }
|
||||||
stack_top:=ptruint(StackBottom)+StackLength;
|
stack_top:=ptruint(StackBottom)+StackLength;
|
||||||
if (ptruint(p)<stack_top) and (ptruint(p)>ptruint(StackBottom)) then
|
if (ptruint(p)<stack_top) and (ptruint(p)>ptruint(StackBottom)) then
|
||||||
goto _exit;
|
exit;
|
||||||
{ inside data or bss ? }
|
{ inside data or bss ? }
|
||||||
{$WARNING data and bss checking missing }
|
{$WARNING data and bss checking missing }
|
||||||
{$endif morphos}
|
{$endif morphos}
|
||||||
@ -1105,7 +1102,7 @@ begin
|
|||||||
// if we find the address in a known area in our current process,
|
// if we find the address in a known area in our current process,
|
||||||
// then it is a valid one
|
// then it is a valid one
|
||||||
if area_for(p) <> B_ERROR then
|
if area_for(p) <> B_ERROR then
|
||||||
goto _exit;
|
exit;
|
||||||
{$endif BEOS}
|
{$endif BEOS}
|
||||||
|
|
||||||
{ first try valid list faster }
|
{ first try valid list faster }
|
||||||
@ -1125,7 +1122,7 @@ begin
|
|||||||
{ special case of the fill_extra_info call }
|
{ special case of the fill_extra_info call }
|
||||||
((pp=loc_info^.heap_valid_last) and usecrc and (pp^.sig=$DEADBEEF)
|
((pp=loc_info^.heap_valid_last) and usecrc and (pp^.sig=$DEADBEEF)
|
||||||
and loc_info^.inside_trace_getmem) then
|
and loc_info^.inside_trace_getmem) then
|
||||||
goto _exit
|
exit
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
writeln(ptext^,'corrupted heap_mem_info');
|
writeln(ptext^,'corrupted heap_mem_info');
|
||||||
@ -1153,7 +1150,7 @@ begin
|
|||||||
{ allocated block }
|
{ allocated block }
|
||||||
if ((pp^.sig=$DEADBEEF) and not usecrc) or
|
if ((pp^.sig=$DEADBEEF) and not usecrc) or
|
||||||
((pp^.sig=calculate_sig(pp)) and usecrc) then
|
((pp^.sig=calculate_sig(pp)) and usecrc) then
|
||||||
goto _exit
|
exit
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
writeln(ptext^,'pointer $',hexstr(p),' points into invalid memory block');
|
writeln(ptext^,'pointer $',hexstr(p),' points into invalid memory block');
|
||||||
@ -1174,7 +1171,6 @@ begin
|
|||||||
get_caller_stackinfo(bp,pcaddr);
|
get_caller_stackinfo(bp,pcaddr);
|
||||||
dump_stack(ptext^,bp,pcaddr);
|
dump_stack(ptext^,bp,pcaddr);
|
||||||
runerror(204);
|
runerror(204);
|
||||||
_exit:
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user