From c4243fb1da166706532e9e88bef99a9b835175da Mon Sep 17 00:00:00 2001 From: radrow Date: Sun, 3 Jul 2022 17:08:04 +0200 Subject: [PATCH] . --- src/aeso_ast_to_fcode.erl | 2 +- src/aeso_fcode_to_fate.erl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/aeso_ast_to_fcode.erl b/src/aeso_ast_to_fcode.erl index 2c25542..8162953 100644 --- a/src/aeso_ast_to_fcode.erl +++ b/src/aeso_ast_to_fcode.erl @@ -656,7 +656,7 @@ expr_to_fcode(Env, _Type, {list, _, Es}) -> expr_to_fcode(Env, _Type, {app, _, {'..', _}, [A, B]}) -> St = fresh_name(), Init = expr_to_fcode(Env, A), - Loop = {loop, Init, St, make_if({op, '<', [{var, St}, expr_to_fcode(Env, B)]}, + Loop = {loop, {}, St, make_if({op, '<', [{var, St}, expr_to_fcode(Env, B)]}, {continue, {op, '+', [{var, St}, {lit, {int, 1}}]}}, {break, nil} )}, diff --git a/src/aeso_fcode_to_fate.erl b/src/aeso_fcode_to_fate.erl index 0bb5107..817e5d9 100644 --- a/src/aeso_fcode_to_fate.erl +++ b/src/aeso_fcode_to_fate.erl @@ -375,14 +375,14 @@ to_scode1(Env, {closure, Fun, FVs}) -> to_scode1(Env, {loop, Init, It, Expr}) -> ContRef = make_ref(), BreakRef = make_ref(), - InitS = to_scode(Env, Init) ++ [{jump, ContRef}], {ItV, Env1} = bind_local(It, Env), + InitS = to_scode(Env, Init) ++ [aeb_fate_ops:store({var, ItV}, {stack, 0}), {jump, ContRef}], ExprS = to_scode(bind_loop(ContRef, BreakRef, ItV, Env1), Expr) ++ [{jumpif, ?a, ContRef}, {jump, BreakRef}], [{loop, InitS, It, ExprS, ContRef, BreakRef}]; -to_scode1(Env = #env{cont_ref = ContRef, loop_it = It}, {continue, Expr}) -> +to_scode1(Env = #env{loop_it = It}, {continue, Expr}) -> ExprS = to_scode1(Env, Expr), - ExprS ++ [{'STORE', It, ?a}, push(?i(1))]; -to_scode1(Env = #env{break_ref = BreakRef}, {break, Expr}) -> + ExprS ++ [aeb_fate_ops:store({var, It}, {stack, 0}), push(?i(1))]; +to_scode1(Env, {break, Expr}) -> ExprS = to_scode1(Env, Expr), ExprS ++ [push(?i(0))]; to_scode1(Env, {switch, Case}) ->