+ added 'else' tracking for the if..end_if blocks

This commit is contained in:
Nikolay Nikolov 2021-10-23 11:56:25 +03:00
parent 7bef4d827d
commit 7f1050464a

View File

@ -323,6 +323,7 @@ implementation
twasmblockitem = class(TLinkedListItem)
blockstart: taicpu;
elseinstr: taicpu;
constructor Create(ablockstart: taicpu);
end;
@ -464,6 +465,16 @@ implementation
inc(cur_nesting_depth);
end;
a_else:
begin
cblock:=twasmblockitem(blockstack.Last);
if (cblock=nil) or
(cblock.blockstart.opcode<>a_if) or
assigned(cblock.elseinstr) then
internalerror(2021102302);
cblock.elseinstr:=lastinstr;
end;
a_end_block,
a_end_loop,
a_end_if,