فهرست منبع

+ WebAssembly: check for exceptions after call of fpc_rangeerror in branchful
exceptions mode. This fixes catching of ERangeError exceptions when using
SysUtils and runtime errors are converted to exceptions.

Nikolay Nikolov 11 ماه پیش
والد
کامیت
b6527c6c03
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      compiler/wasm32/hlcgcpu.pas

+ 3 - 0
compiler/wasm32/hlcgcpu.pas

@@ -2275,6 +2275,7 @@ implementation
                   (lto > aintmax) then
                   (lto > aintmax) then
                  begin
                  begin
                    g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
                    g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
+                   hlcg.g_maybe_checkforexceptions(current_asmdata.CurrAsmList);
                    exit
                    exit
                  end;
                  end;
                { from is signed and to is unsigned -> when looking at to }
                { from is signed and to is unsigned -> when looking at to }
@@ -2290,6 +2291,7 @@ implementation
                   (hto < 0) then
                   (hto < 0) then
                  begin
                  begin
                    g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
                    g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
+                   hlcg.g_maybe_checkforexceptions(current_asmdata.CurrAsmList);
                    exit
                    exit
                  end;
                  end;
                { from is unsigned and to is signed -> when looking at to }
                { from is unsigned and to is signed -> when looking at to }
@@ -2319,6 +2321,7 @@ implementation
       thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
       thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
 
 
       g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
       g_call_system_proc(list,'fpc_rangeerror',[],nil).resetiftemp;
+      hlcg.g_maybe_checkforexceptions(current_asmdata.CurrAsmList);
 
 
       current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_if));
       current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_if));
     end;
     end;