Try to implement CheckPointer exclusion range for FreeBSD OS

git-svn-id: trunk@39394 -
This commit is contained in:
pierre 2018-07-06 09:08:54 +00:00
parent 7d96c2a368
commit 18cc1f1709

View File

@ -968,6 +968,13 @@ var
eend : ptruint; external name '_end';
{$endif}
{$ifdef freebsd}
var
text_start: ptruint; external name '__executable_start';
etext: ptruint; external name '_etext';
eend : ptruint; external name '_end';
{$endif}
{$ifdef os2}
(* Currently still EMX based - possibly to be changed in the future. *)
var
@ -1081,6 +1088,15 @@ begin
exit;
{$endif linux}
{$ifdef freebsd}
{ inside stack ? }
if (ptruint(p)>ptruint(get_frame)) and
(ptruint(p)<ptruint(StackTop)) then
exit;
{ inside data or bss ? }
if (ptruint(p)>=ptruint(@text_start)) and (ptruint(p)<ptruint(@eend)) then
exit;
{$endif linux}
{$ifdef morphos}
{ inside stack ? }
if (ptruint(p)<ptruint(StackTop)) and (ptruint(p)>ptruint(StackBottom)) then