mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Fix Whales' nominator case
This commit is contained in:
parent
5368287d5f
commit
7a407c4fe3
2 changed files with 11 additions and 11 deletions
|
@ -137,7 +137,7 @@ int apply_profit(int value, int value_profit, int profit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
;; Try to withdraw from withdraw balance
|
;; Try to withdraw from withdraw balance
|
||||||
if ((remaining > 0) & ctx_member_withdraw > 0) {
|
if (((remaining > 0) & ctx_member_withdraw) > 0) {
|
||||||
int delta = min(ctx_member_withdraw, remaining);
|
int delta = min(ctx_member_withdraw, remaining);
|
||||||
ctx_member_withdraw = ctx_member_withdraw - delta;
|
ctx_member_withdraw = ctx_member_withdraw - delta;
|
||||||
ctx_balance_withdraw = ctx_balance_withdraw - delta;
|
ctx_balance_withdraw = ctx_balance_withdraw - delta;
|
||||||
|
|
|
@ -852,7 +852,7 @@ Expr* parse_expr20(Lexer& lex, CodeBlob& code, bool nv) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse E { ( << | >> | >>~ | >>^ ) E }
|
// parse E { ( << | >> | ~>> | ^>> ) E }
|
||||||
Expr* parse_expr17(Lexer& lex, CodeBlob& code, bool nv) {
|
Expr* parse_expr17(Lexer& lex, CodeBlob& code, bool nv) {
|
||||||
Expr* res = parse_expr20(lex, code, nv);
|
Expr* res = parse_expr20(lex, code, nv);
|
||||||
while (lex.tp() == _Lshift || lex.tp() == _Rshift || lex.tp() == _RshiftC || lex.tp() == _RshiftR) {
|
while (lex.tp() == _Lshift || lex.tp() == _Rshift || lex.tp() == _RshiftC || lex.tp() == _RshiftR) {
|
||||||
|
@ -895,17 +895,17 @@ Expr* parse_expr15(Lexer& lex, CodeBlob& code, bool nv) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse E [ ( & | ^ | '|' ) E ]
|
// parse E { ( '|' | & | ^ ) E }
|
||||||
Expr* parse_expr14(Lexer& lex, CodeBlob& code, bool nv) {
|
Expr* parse_expr14(Lexer& lex, CodeBlob& code, const bool nv) {
|
||||||
Expr* res = parse_expr15(lex, code, nv);
|
Expr* res = parse_expr15(lex, code, nv);
|
||||||
if (lex.tp() == '&' || lex.tp() == '^' || lex.tp() == '|') {
|
while (lex.tp() == '|' || lex.tp() == '&' || lex.tp() == '^') {
|
||||||
res->chk_rvalue(lex.cur());
|
res->chk_rvalue(lex.cur());
|
||||||
int t = lex.tp();
|
int t = lex.tp();
|
||||||
sym_idx_t name = symbols.lookup_add(std::string{"_"} + lex.cur().str + "_");
|
const sym_idx_t name = symbols.lookup_add(std::string{"_"} + lex.cur().str + "_");
|
||||||
check_global_func(lex.cur(), name);
|
check_global_func(lex.cur(), name);
|
||||||
SrcLocation loc{lex.cur().loc};
|
const SrcLocation loc{lex.cur().loc};
|
||||||
lex.next();
|
lex.next();
|
||||||
auto x = parse_expr14(lex, code, false);
|
auto x = parse_expr15(lex, code, false);
|
||||||
x->chk_rvalue(lex.cur());
|
x->chk_rvalue(lex.cur());
|
||||||
res = new Expr{Expr::_Apply, name, {res, x}};
|
res = new Expr{Expr::_Apply, name, {res, x}};
|
||||||
res->here = loc;
|
res->here = loc;
|
||||||
|
@ -926,7 +926,7 @@ Expr* parse_expr13(Lexer& lex, CodeBlob& code, bool nv) {
|
||||||
auto x = parse_expr(lex, code, false);
|
auto x = parse_expr(lex, code, false);
|
||||||
x->chk_rvalue(lex.cur());
|
x->chk_rvalue(lex.cur());
|
||||||
lex.expect(':');
|
lex.expect(':');
|
||||||
auto y = parse_expr14(lex, code, false);
|
auto y = parse_expr13(lex, code, false);
|
||||||
y->chk_rvalue(lex.cur());
|
y->chk_rvalue(lex.cur());
|
||||||
res = new Expr{Expr::_CondExpr, {res, x, y}};
|
res = new Expr{Expr::_CondExpr, {res, x, y}};
|
||||||
res->here = loc;
|
res->here = loc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue