From 5cd1c4f5bc38865143db8ddecb06a6ed549e688a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Kl=C3=A4mpfl?= Date: Sun, 23 Jan 2022 17:31:55 +0100 Subject: [PATCH] * manually fix unwanted stripping of exception frame info based on a patch by Gareth J. Moreton --- compiler/aoptobj.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index 9cc84c212d..f5f8232f10 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -1506,7 +1506,15 @@ Unit AoptObj; var p,hp1,hp2 : tai; stoploop:boolean; - begin + const +{$ifdef JVM} + TaiFence = SkipInstr + [ait_const, ait_realconst, ait_typedconst, ait_label, ait_jcatch]; +{$else JVM} + { Stop if it reaches SEH directive information in the form of + consts, which may occur if RemoveDeadCodeAfterJump is called on + the final RET instruction on x86, for example } + TaiFence = SkipInstr + [ait_const, ait_realconst, ait_typedconst, ait_label, ait_align]; +{$endif JVM} begin repeat stoploop:=true; p := BlockStart; @@ -1545,7 +1553,7 @@ Unit AoptObj; and (hp1.typ <> ait_jcatch) {$endif} do - if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then + if not(hp1.typ in TaiFence) then begin if (hp1.typ = ait_instruction) and taicpu(hp1).is_jmp and