diff --git a/compiler/i386/cgcpu.pas b/compiler/i386/cgcpu.pas index dacfaba87d..51ecdb7bd4 100644 --- a/compiler/i386/cgcpu.pas +++ b/compiler/i386/cgcpu.pas @@ -323,6 +323,7 @@ unit cgcpu; internal_restore_regs(list,true); if (current_procinfo.procdef.proctypeoption=potype_exceptfilter) then list.concat(Taicpu.op_reg(A_POP,tcgsize2opsize[OS_ADDR],NR_FRAME_POINTER_REG)); + current_asmdata.asmcfi.cfa_def_cfa_offset(list,sizeof(pint)); end else begin diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index dea398ac92..ed9a263cfd 100644 --- a/compiler/x86/cgx86.pas +++ b/compiler/x86/cgx86.pas @@ -3405,7 +3405,10 @@ unit cgx86; inc(regsize,sizeof(aint)); hreg:=newreg(R_INTREGISTER,regs_to_save_int[r],R_SUBWHOLE); list.concat(Taicpu.Op_reg(A_PUSH,tcgsize2opsize[OS_ADDR],hreg)); - current_asmdata.asmcfi.cfa_offset(list,hreg,-(regsize+localsize)); + if current_procinfo.framepointer<>NR_STACK_POINTER_REG then + current_asmdata.asmcfi.cfa_offset(list,hreg,-(regsize+sizeof(pint)*2+localsize)) + else + current_asmdata.asmcfi.cfa_offset(list,hreg,-(regsize+sizeof(pint)+localsize)); end; end;