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

Fix converting int to int256 (#925)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
EmelyanenkoK 2024-03-04 17:37:42 +03:00 committed by GitHub
parent 310dd6dec1
commit b09f910bf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 15 deletions

View file

@ -595,7 +595,7 @@ td::RefInt256 CellSlice::fetch_int256(unsigned bits, bool sgnd) {
if (!have(bits)) {
return {};
} else if (bits < td::BigInt256::word_shift) {
return td::make_refint(sgnd ? fetch_long(bits) : fetch_ulong(bits));
return td::make_refint(td::int64(sgnd ? fetch_long(bits) : fetch_ulong(bits)));
} else {
td::RefInt256 res{true};
res.unique_write().import_bits(data_bits(), bits, sgnd);
@ -608,7 +608,7 @@ td::RefInt256 CellSlice::prefetch_int256(unsigned bits, bool sgnd) const {
if (!have(bits)) {
return {};
} else if (bits < td::BigInt256::word_shift) {
return td::make_refint(sgnd ? prefetch_long(bits) : prefetch_ulong(bits));
return td::make_refint(td::int64(sgnd ? prefetch_long(bits) : prefetch_ulong(bits)));
} else {
td::RefInt256 res{true};
res.unique_write().import_bits(data_bits(), bits, sgnd);