mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 05:29:30 +02:00
+ more consistency checks for unexpected instructions when converting to wasm structured instruction form
This commit is contained in:
parent
089e7ca6c8
commit
84f0b94549
@ -272,7 +272,7 @@ uses
|
|||||||
p:=tai(srclist.First);
|
p:=tai(srclist.First);
|
||||||
if not assigned(p) then
|
if not assigned(p) then
|
||||||
internalerror(2023100302);
|
internalerror(2023100302);
|
||||||
if (p.typ=ait_instruction) and (taicpu(p).opcode in [a_else,a_end_if]) then
|
if (p.typ=ait_instruction) and (taicpu(p).opcode in [a_else,a_end_if,a_end_block,a_end_loop,a_end_try,a_catch,a_catch_all]) then
|
||||||
begin
|
begin
|
||||||
srclist.Remove(p);
|
srclist.Remove(p);
|
||||||
case taicpu(p).opcode of
|
case taicpu(p).opcode of
|
||||||
@ -539,12 +539,10 @@ uses
|
|||||||
Done:=False;
|
Done:=False;
|
||||||
repeat
|
repeat
|
||||||
pp:=tai(srclist.First);
|
pp:=tai(srclist.First);
|
||||||
if (pp.typ=ait_instruction) and (taicpu(pp).opcode in [a_catch,a_catch_all,a_end_try]) then
|
if (pp.typ=ait_instruction) and (taicpu(pp).opcode=a_end_try) then
|
||||||
begin
|
begin
|
||||||
srclist.Remove(pp);
|
srclist.Remove(pp);
|
||||||
Done:=True;
|
Done:=True;
|
||||||
if taicpu(pp).opcode in [a_catch,a_catch_all] then
|
|
||||||
internalerror(2023100313);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
catch_all_asmlist.Concat(wasm_convert_first_item_to_structured(srclist));
|
catch_all_asmlist.Concat(wasm_convert_first_item_to_structured(srclist));
|
||||||
|
Loading…
Reference in New Issue
Block a user