mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:29:21 +02:00
* fix for exception handling - avoid endless loop in case of fatal exceptions, safer checking for prefetch bug
git-svn-id: trunk@15131 -
This commit is contained in:
parent
393db3d359
commit
a87a867271
@ -172,8 +172,8 @@ function Is_Prefetch (P: pointer): boolean;
|
|||||||
Is_Prefetch := false;
|
Is_Prefetch := false;
|
||||||
|
|
||||||
MemSize := SizeOf (A);
|
MemSize := SizeOf (A);
|
||||||
DosQueryMem (P, MemSize, MemAttrs);
|
if (DosQueryMem (P, MemSize, MemAttrs) = 0) and
|
||||||
if (MemAttrs and (mfPag_Free or mfPag_Commit) <> 0)
|
(MemAttrs and (mfPag_Free or mfPag_Commit) <> 0)
|
||||||
and (MemSize >= SizeOf (A)) then
|
and (MemSize >= SizeOf (A)) then
|
||||||
Move (P^, A [0], SizeOf (A))
|
Move (P^, A [0], SizeOf (A))
|
||||||
else
|
else
|
||||||
@ -396,7 +396,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (Err <> 0) and (ExceptLevel < MaxExceptionLevel) then
|
if (Err <> 0) and (ExceptLevel < MaxExceptionLevel)
|
||||||
|
(* TH: The following line is necessary to avoid an endless loop *)
|
||||||
|
and (Report^.Exception_Num < Xcpt_Process_Terminate)
|
||||||
|
then
|
||||||
begin
|
begin
|
||||||
ExceptEIP [ExceptLevel] := Context^.Reg_EIP;
|
ExceptEIP [ExceptLevel] := Context^.Reg_EIP;
|
||||||
ExceptError [ExceptLevel] := Err;
|
ExceptError [ExceptLevel] := Err;
|
||||||
|
Loading…
Reference in New Issue
Block a user