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

[FunC] Change priority of & | ^ operators to a more intuitive one

Before, such code `if (slices_equal() & status == 1)` was parsed
as `if( (slices_equal()&status) == 1 )`.
Note, that this change leads to hash changes of some verified contracts,
but a new priority is more expected from the user experience.
This commit is contained in:
Aleksandr Kirsanov 2024-05-11 13:57:42 +03:00
parent aee51731ce
commit 7afa9292c3
No known key found for this signature in database
GPG key ID: B758BBAA01FFB3D3
3 changed files with 77 additions and 8 deletions

View file

@ -137,7 +137,7 @@ int apply_profit(int value, int value_profit, int profit) {
}
;; Try to withdraw from withdraw balance
if ((remaining > 0) & ctx_member_withdraw > 0) {
if (((remaining > 0) & ctx_member_withdraw) > 0) { ;; such strange brackets to remain hash stable after & priority fix
int delta = min(ctx_member_withdraw, remaining);
ctx_member_withdraw = ctx_member_withdraw - delta;
ctx_balance_withdraw = ctx_balance_withdraw - delta;
@ -294,4 +294,4 @@ int owned_balance() {
;; Reset sent amount
ctx_balance_sent = 0;
}
}