mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:29:27 +02:00
+ insert try and end_try instructions in the try..finally code in native
WebAssembly exceptions mode
This commit is contained in:
parent
45e53ddc16
commit
619a27cbfc
@ -605,6 +605,10 @@ implementation
|
||||
thlcgwasm(hlcg).loopContBr:=thlcgwasm(hlcg).br_blocks;
|
||||
end;
|
||||
|
||||
{ the inner 'try..end_try' block }
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_try));
|
||||
thlcgwasm(hlcg).incblock;
|
||||
|
||||
{ try code }
|
||||
if assigned(left) then
|
||||
begin
|
||||
@ -620,7 +624,11 @@ implementation
|
||||
|
||||
{ we've reached the end of the 'try' block, with no exceptions/exit/break/continue, so set exceptionreason:=0 }
|
||||
hlcg.g_exception_reason_save_const(current_asmdata.CurrAsmList,exceptionreasontype,0,excepttemps.reasonbuf);
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,3)); // jump to the 'finally' section
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,4)); // jump to the 'finally' section
|
||||
|
||||
{ exit the inner 'try..end_try' block }
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_try));
|
||||
thlcgwasm(hlcg).decblock;
|
||||
|
||||
{ exit the 'continue' block }
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_block));
|
||||
|
Loading…
Reference in New Issue
Block a user