mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 07:09:29 +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;
|
||||
|
||||
MemSize := SizeOf (A);
|
||||
DosQueryMem (P, MemSize, MemAttrs);
|
||||
if (MemAttrs and (mfPag_Free or mfPag_Commit) <> 0)
|
||||
if (DosQueryMem (P, MemSize, MemAttrs) = 0) and
|
||||
(MemAttrs and (mfPag_Free or mfPag_Commit) <> 0)
|
||||
and (MemSize >= SizeOf (A)) then
|
||||
Move (P^, A [0], SizeOf (A))
|
||||
else
|
||||
@ -396,7 +396,10 @@ begin
|
||||
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
|
||||
ExceptEIP [ExceptLevel] := Context^.Reg_EIP;
|
||||
ExceptError [ExceptLevel] := Err;
|
||||
|
Loading…
Reference in New Issue
Block a user