mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 19:29:24 +02:00
+ generate exception checks after calls to fpc_overflow class in WebAssembly
branchful exceptions mode, because fpc_overflow can raise an exception in case unit SysUtils is included.
This commit is contained in:
parent
b2350d90ea
commit
9b16fafc52
@ -2169,6 +2169,7 @@ implementation
|
||||
list.concat(taicpu.op_none(a_block));
|
||||
a_cmp_const_loc_label(list,s32inttype,OC_EQ,0,ovloc,hl);
|
||||
g_call_system_proc(list,'fpc_overflow',[],nil);
|
||||
hlcg.g_maybe_checkforexceptions(current_asmdata.CurrAsmList);
|
||||
list.concat(taicpu.op_none(a_end_block));
|
||||
a_label(list,hl);
|
||||
end;
|
||||
|
@ -162,6 +162,7 @@ implementation
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_block));
|
||||
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,resultdef,OC_NE,-1,tmpreg,lab);
|
||||
hlcg.g_call_system_proc(current_asmdata.CurrAsmList,'fpc_overflow',[],nil);
|
||||
hlcg.g_maybe_checkforexceptions(current_asmdata.CurrAsmList);
|
||||
hlcg.a_label(current_asmdata.CurrAsmList,lab);
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_block));
|
||||
end;
|
||||
@ -228,6 +229,7 @@ implementation
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_block));
|
||||
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,resultdef,OC_NE,torddef(resultdef).low.svalue,left.location.register,hl);
|
||||
hlcg.g_call_system_proc(current_asmdata.CurrAsmList,'fpc_overflow',[],nil).resetiftemp;
|
||||
hlcg.g_maybe_checkforexceptions(current_asmdata.CurrAsmList);
|
||||
hlcg.a_label(current_asmdata.CurrAsmList,hl);
|
||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_block));
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user