mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
vm bugfixes
This commit is contained in:
parent
e27fb1e09c
commit
dd4ac0f440
9 changed files with 107 additions and 30 deletions
|
@ -500,8 +500,8 @@ bool HashmapE::add_values(vm::CellBuilder& cb, vm::CellSlice& cs1, vm::CellSlice
|
|||
int n = root_type.n;
|
||||
vm::Dictionary dict1{vm::DictAdvance(), cs1, n}, dict2{vm::DictAdvance(), cs2, n};
|
||||
const TLB& vt = root_type.value_type;
|
||||
vm::Dictionary::simple_combine_func_t combine = [vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
vm::Dictionary::simple_combine_func_t combine = [&vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
if (!vt.add_values(cb, cs1_ref.write(), cs2_ref.write())) {
|
||||
throw CombineError{};
|
||||
}
|
||||
|
@ -514,8 +514,8 @@ bool HashmapE::add_values_ref(Ref<vm::Cell>& res, Ref<vm::Cell> arg1, Ref<vm::Ce
|
|||
int n = root_type.n;
|
||||
vm::Dictionary dict1{std::move(arg1), n}, dict2{std::move(arg2), n};
|
||||
const TLB& vt = root_type.value_type;
|
||||
vm::Dictionary::simple_combine_func_t combine = [vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
vm::Dictionary::simple_combine_func_t combine = [&vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
if (!vt.add_values(cb, cs1_ref.write(), cs2_ref.write())) {
|
||||
throw CombineError{};
|
||||
}
|
||||
|
@ -535,8 +535,8 @@ int HashmapE::sub_values(vm::CellBuilder& cb, vm::CellSlice& cs1, vm::CellSlice&
|
|||
int n = root_type.n;
|
||||
vm::Dictionary dict1{vm::DictAdvance(), cs1, n}, dict2{vm::DictAdvance(), cs2, n};
|
||||
const TLB& vt = root_type.value_type;
|
||||
vm::Dictionary::simple_combine_func_t combine = [vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
vm::Dictionary::simple_combine_func_t combine = [&vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
int r = vt.sub_values(cb, cs1_ref.write(), cs2_ref.write());
|
||||
if (r < 0) {
|
||||
throw CombineError{};
|
||||
|
@ -555,8 +555,8 @@ int HashmapE::sub_values_ref(Ref<vm::Cell>& res, Ref<vm::Cell> arg1, Ref<vm::Cel
|
|||
int n = root_type.n;
|
||||
vm::Dictionary dict1{std::move(arg1), n}, dict2{std::move(arg2), n};
|
||||
const TLB& vt = root_type.value_type;
|
||||
vm::Dictionary::simple_combine_func_t combine = [vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
vm::Dictionary::simple_combine_func_t combine = [&vt](vm::CellBuilder& cb, Ref<vm::CellSlice> cs1_ref,
|
||||
Ref<vm::CellSlice> cs2_ref) -> bool {
|
||||
int r = vt.sub_values(cb, cs1_ref.write(), cs2_ref.write());
|
||||
if (r < 0) {
|
||||
throw CombineError{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue