* 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:
Tomas Hajny 2010-04-11 00:37:01 +00:00
parent 393db3d359
commit a87a867271

View File

@ -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;