diff --git a/compiler/wasm32/hlcgcpu.pas b/compiler/wasm32/hlcgcpu.pas index ead082c806..dbc9bf4347 100644 --- a/compiler/wasm32/hlcgcpu.pas +++ b/compiler/wasm32/hlcgcpu.pas @@ -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; diff --git a/compiler/wasm32/nwasmmat.pas b/compiler/wasm32/nwasmmat.pas index c7de6c3dd1..6b53356132 100644 --- a/compiler/wasm32/nwasmmat.pas +++ b/compiler/wasm32/nwasmmat.pas @@ -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;