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

Fix check_underflow in some instructions

This commit is contained in:
SpyCheese 2024-12-17 11:16:43 +03:00
parent ce58805104
commit f03f6ce7ca
3 changed files with 15 additions and 4 deletions

View file

@ -566,7 +566,7 @@ int exec_dict_getnear(VmState* st, unsigned args) {
int exec_pfx_dict_set(VmState* st, Dictionary::SetMode mode, const char* name) {
Stack& stack = st->get_stack();
VM_LOG(st) << "execute PFXDICT" << name;
stack.check_underflow(3);
stack.check_underflow(st->get_global_version() >= 9 ? 4 : 3);
int n = stack.pop_smallint_range(PrefixDictionary::max_key_bits);
PrefixDictionary dict{stack.pop_maybe_cell(), n};
auto key_slice = stack.pop_cellslice();
@ -580,7 +580,7 @@ int exec_pfx_dict_set(VmState* st, Dictionary::SetMode mode, const char* name) {
int exec_pfx_dict_delete(VmState* st) {
Stack& stack = st->get_stack();
VM_LOG(st) << "execute PFXDICTDEL\n";
stack.check_underflow(2);
stack.check_underflow(st->get_global_version() >= 9 ? 3 : 2);
int n = stack.pop_smallint_range(PrefixDictionary::max_key_bits);
PrefixDictionary dict{stack.pop_maybe_cell(), n};
auto key_slice = stack.pop_cellslice();