mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 05:08:06 +02:00
+ added unhandled exception handling code for the branchful exceptions mode
This commit is contained in:
parent
a01a602140
commit
c0cec218d6
@ -17,6 +17,10 @@
|
||||
|
||||
unit si_prc;
|
||||
|
||||
{$ifdef FPC_WASM_BRANCHFUL_EXCEPTIONS}
|
||||
{$MODESWITCH EXCEPTIONS}
|
||||
{$endif}
|
||||
|
||||
interface
|
||||
|
||||
procedure _start;
|
||||
@ -25,10 +29,23 @@ implementation
|
||||
|
||||
procedure PASCALMAIN; external 'PASCALMAIN';
|
||||
|
||||
{$ifdef FPC_WASM_BRANCHFUL_EXCEPTIONS}
|
||||
Procedure DoUnHandledException; external name 'FPC_DOUNHANDLEDEXCEPTION';
|
||||
|
||||
procedure _start;
|
||||
begin
|
||||
try
|
||||
PASCALMAIN;
|
||||
except
|
||||
DoUnhandledException;
|
||||
end;
|
||||
end;
|
||||
{$else}
|
||||
procedure _start;
|
||||
begin
|
||||
PASCALMAIN;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
exports
|
||||
_start;
|
||||
|
@ -134,7 +134,7 @@ begin
|
||||
Result:=NewObj;
|
||||
end;
|
||||
|
||||
Procedure DoUnHandledException;
|
||||
Procedure DoUnHandledException;[Public, Alias : 'FPC_DOUNHANDLEDEXCEPTION'];
|
||||
var
|
||||
_ExceptObjectStack : PExceptObject;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user