summaryrefslogtreecommitdiff
path: root/compiler/ncgflw.pas
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-02-27 16:47:36 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-02-27 16:47:36 +0000
commit2a888967629017b70f3dbdf297719e41a5993a48 (patch)
tree8fa0eae7278699e0116990bce4b72a74ad94fa69 /compiler/ncgflw.pas
parent696deeab2428bbb1d80a6cb7e5753300bb660d77 (diff)
downloadfpc-2a888967629017b70f3dbdf297719e41a5993a48.tar.gz
* for setjmp based exception handling, get the type of the exception reason from the setjmp result
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@48828 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ncgflw.pas')
-rw-r--r--compiler/ncgflw.pas24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/ncgflw.pas b/compiler/ncgflw.pas
index 601a74919a..902c81d952 100644
--- a/compiler/ncgflw.pas
+++ b/compiler/ncgflw.pas
@@ -542,7 +542,7 @@ implementation
{ we must also destroy the address frame which guards
the exception object }
cexceptionstatehandler.popaddrstack(list);
- hlcg.g_exception_reason_discard(list,osuinttype,excepttemps.reasonbuf);
+ hlcg.g_exception_reason_discard(list,setjmpresulttype,excepttemps.reasonbuf);
if frametype=ft_except then
begin
cexceptionstatehandler.cleanupobjectstack(list);
@@ -875,8 +875,8 @@ implementation
procedure tcgtryfinallynode.emit_jump_out_of_try_finally_frame(list: TasmList; const reason: byte; const finallycodelabel: tasmlabel; var excepttemps: tcgexceptionstatehandler.texceptiontemps; framelabel: tasmlabel);
begin
hlcg.a_label(list,framelabel);
- hlcg.g_exception_reason_discard(list,osuinttype,excepttemps.reasonbuf);
- hlcg.g_exception_reason_save_const(list,osuinttype,reason,excepttemps.reasonbuf);
+ hlcg.g_exception_reason_discard(list,setjmpresulttype,excepttemps.reasonbuf);
+ hlcg.g_exception_reason_save_const(list,setjmpresulttype,reason,excepttemps.reasonbuf);
hlcg.a_jmp_always(list,finallycodelabel);
end;
@@ -936,13 +936,13 @@ implementation
procedure handle_breakcontinueexit(const finallycode: tasmlabel; doreraise: boolean);
begin
{ no exception happened, but maybe break/continue/exit }
- hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,osuinttype,OC_EQ,0,reasonreg,endfinallylabel);
+ hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,setjmpresulttype,OC_EQ,0,reasonreg,endfinallylabel);
if fc_exit in finallyexceptionstate.newflowcontrol then
- hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,osuinttype,OC_EQ,2,reasonreg,oldCurrExitLabel);
+ hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,setjmpresulttype,OC_EQ,2,reasonreg,oldCurrExitLabel);
if fc_break in finallyexceptionstate.newflowcontrol then
- hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,osuinttype,OC_EQ,3,reasonreg,oldBreakLabel);
+ hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,setjmpresulttype,OC_EQ,3,reasonreg,oldBreakLabel);
if fc_continue in finallyexceptionstate.newflowcontrol then
- hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,osuinttype,OC_EQ,4,reasonreg,oldContinueLabel);
+ hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,setjmpresulttype,OC_EQ,4,reasonreg,oldContinueLabel);
if doreraise then
cexceptionstatehandler.handle_reraise(current_asmdata.CurrAsmList,excepttemps,finallyexceptionstate,tek_normalfinally)
else
@@ -1019,8 +1019,8 @@ implementation
exit;
if not implicitframe then
current_asmdata.CurrAsmList.concat(tai_marker.create(mark_NoLineInfoStart));
- reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,osuinttype);
- hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,osuinttype,osuinttype,excepttemps.reasonbuf,reasonreg);
+ reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,setjmpresulttype);
+ hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,setjmpresulttype,setjmpresulttype,excepttemps.reasonbuf,reasonreg);
handle_breakcontinueexit(finallyNoExceptionLabel,false);
current_asmdata.CurrAsmList.concatList(tmplist);
@@ -1058,11 +1058,11 @@ implementation
if not assigned(third) then
begin
{ the value should now be in the exception handler }
- reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,osuinttype);
- hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,osuinttype,osuinttype,excepttemps.reasonbuf,reasonreg);
+ reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,setjmpresulttype);
+ hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,setjmpresulttype,setjmpresulttype,excepttemps.reasonbuf,reasonreg);
if implicitframe then
begin
- hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,osuinttype,OC_EQ,0,reasonreg,endfinallylabel);
+ hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,setjmpresulttype,OC_EQ,0,reasonreg,endfinallylabel);
{ finally code only needed to be executed on exception (-> in
if-branch -> fc_inflowcontrol) }
if current_procinfo.procdef.generate_safecall_wrapper then