* give runerror 231 if exceptobjectstack=nil

git-svn-id: trunk@401 -
This commit is contained in:
peter 2005-06-14 05:22:18 +00:00
parent 26646298a4
commit 58cdeb8184

View File

@ -42,33 +42,36 @@ ThreadVar
ExceptAddrStack : PExceptAddr; ExceptAddrStack : PExceptAddr;
ExceptObjectStack : PExceptObject; ExceptObjectStack : PExceptObject;
{$IFNDEF VIRTUALPASCAL}
Function RaiseList : PExceptObject; Function RaiseList : PExceptObject;
begin begin
RaiseList:=ExceptObjectStack; RaiseList:=ExceptObjectStack;
end; end;
{$ENDIF}
function AcquireExceptionObject: Pointer; function AcquireExceptionObject: Pointer;
begin begin
If ExceptObjectStack=nil then begin If ExceptObjectStack<>nil then
AcquireExceptionObject := nil begin
end else begin Inc(ExceptObjectStack^.refcount);
Inc(ExceptObjectStack^.refcount); AcquireExceptionObject := ExceptObjectStack^.FObject;
AcquireExceptionObject := ExceptObjectStack^.FObject; end
end; else
RunError(231);
end; end;
procedure ReleaseExceptionObject; procedure ReleaseExceptionObject;
begin begin
If ExceptObjectStack <> nil then begin If ExceptObjectStack <> nil then
if ExceptObjectStack^.refcount > 0 then begin begin
Dec(ExceptObjectStack^.refcount); if ExceptObjectStack^.refcount > 0 then
end; Dec(ExceptObjectStack^.refcount);
end; end
else
RunError(231);
end; end;
Function fpc_PushExceptAddr (Ft: Longint;_buf,_newaddr : pointer): PJmp_buf ; Function fpc_PushExceptAddr (Ft: Longint;_buf,_newaddr : pointer): PJmp_buf ;
[Public, Alias : 'FPC_PUSHEXCEPTADDR'];compilerproc; [Public, Alias : 'FPC_PUSHEXCEPTADDR'];compilerproc;