* manually fix unwanted stripping of exception frame info based on a patch by Gareth J. Moreton

This commit is contained in:
Florian Klämpfl 2022-01-23 17:31:55 +01:00
parent 08bb8c8dfc
commit 5cd1c4f5bc

View File

@ -1506,7 +1506,15 @@ Unit AoptObj;
var var
p,hp1,hp2 : tai; p,hp1,hp2 : tai;
stoploop:boolean; 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 repeat
stoploop:=true; stoploop:=true;
p := BlockStart; p := BlockStart;
@ -1545,7 +1553,7 @@ Unit AoptObj;
and (hp1.typ <> ait_jcatch) and (hp1.typ <> ait_jcatch)
{$endif} {$endif}
do do
if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then if not(hp1.typ in TaiFence) then
begin begin
if (hp1.typ = ait_instruction) and if (hp1.typ = ait_instruction) and
taicpu(hp1).is_jmp and taicpu(hp1).is_jmp and