+ Patch to return nil if there is no exception object (as in Delphi)

This commit is contained in:
michael 2005-05-08 21:20:26 +00:00
parent fd8927391f
commit 71f56b3d61

View File

@ -57,7 +57,7 @@ end;
function AcquireExceptionObject: Pointer; function AcquireExceptionObject: Pointer;
begin begin
If ExceptObjectStack=nil then begin If ExceptObjectStack=nil then begin
runerror(231); // which error? AcquireExceptionObject := nil
end else begin end else begin
Inc(ExceptObjectStack^.refcount); Inc(ExceptObjectStack^.refcount);
AcquireExceptionObject := ExceptObjectStack^.FObject; AcquireExceptionObject := ExceptObjectStack^.FObject;
@ -66,15 +66,12 @@ end;
procedure ReleaseExceptionObject; procedure ReleaseExceptionObject;
begin begin
If ExceptObjectStack=nil then begin If ExceptObjectStack <> nil then begin
runerror(231); // which error? if ExceptObjectStack^.refcount > 0 then begin
end else begin
if ExceptObjectStack^.refcount = 0 then begin
runerror(231); // which error?
end;
Dec(ExceptObjectStack^.refcount); Dec(ExceptObjectStack^.refcount);
end; end;
end; end;
end;
{$ifndef HAS_ADDR_STACK_ON_STACK} {$ifndef HAS_ADDR_STACK_ON_STACK}
Function fpc_PushExceptAddr (Ft: Longint): PJmp_buf ; Function fpc_PushExceptAddr (Ft: Longint): PJmp_buf ;
@ -349,7 +346,10 @@ begin
end; end;
{ {
$Log$ $Log$
Revision 1.20 2005-04-03 11:32:05 florian Revision 1.21 2005-05-08 21:20:26 michael
+ Patch to return nil if there is no exception object (as in Delphi)
Revision 1.20 2005/04/03 11:32:05 florian
* ref. counting for popping second exceptiono object fixed * ref. counting for popping second exceptiono object fixed
Revision 1.19 2005/02/14 17:13:22 peter Revision 1.19 2005/02/14 17:13:22 peter