mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Fix some error handling in FunC (#599)
This commit is contained in:
parent
653c88aa9d
commit
c6143715cc
5 changed files with 33 additions and 15 deletions
|
@ -663,12 +663,20 @@ bool Op::generate_code_step(Stack& stack) {
|
|||
stack.o << "REPEAT:<{";
|
||||
stack.o.indent();
|
||||
stack.forget_const();
|
||||
StackLayout layout1 = stack.vars();
|
||||
stack.mode &= ~Stack::_InlineFunc;
|
||||
stack.mode |= Stack::_NeedRetAlt;
|
||||
block0->generate_code_all(stack);
|
||||
stack.enforce_state(std::move(layout1));
|
||||
stack.opt_show();
|
||||
if (block0->noreturn()) {
|
||||
Stack stack_copy{stack};
|
||||
StackLayout layout1 = stack.vars();
|
||||
stack_copy.mode &= ~Stack::_InlineFunc;
|
||||
stack_copy.mode |= Stack::_NeedRetAlt;
|
||||
block0->generate_code_all(stack_copy);
|
||||
} else {
|
||||
StackLayout layout1 = stack.vars();
|
||||
stack.mode &= ~Stack::_InlineFunc;
|
||||
stack.mode |= Stack::_NeedRetAlt;
|
||||
block0->generate_code_all(stack);
|
||||
stack.enforce_state(std::move(layout1));
|
||||
stack.opt_show();
|
||||
}
|
||||
stack.o.undent();
|
||||
stack.o << "}>";
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue