1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Get rid of recursion in tvm continuations

This commit is contained in:
SpyCheese 2024-09-20 15:16:27 +03:00
parent eea95aeebb
commit b5734d2e30
3 changed files with 72 additions and 66 deletions

View file

@ -370,7 +370,11 @@ class VmState final : public VmStateInterface {
throw VmFatal{};
}
int jump_to(Ref<Continuation> cont) {
return cont->is_unique() ? cont.unique_write().jump_w(this) : cont->jump(this);
int res = 0;
while (cont.not_null()) {
cont = cont->is_unique() ? cont.unique_write().jump_w(this, res) : cont->jump(this, res);
}
return res;
}
static Ref<CellSlice> convert_code_cell(Ref<Cell> code_cell);
bool try_commit();