diff --git a/src/script_opt/Expr.cc b/src/script_opt/Expr.cc index 235a5f09f0..f06d6f9a0c 100644 --- a/src/script_opt/Expr.cc +++ b/src/script_opt/Expr.cc @@ -2347,9 +2347,6 @@ ExprPtr InlineExpr::Reduce(Reducer* c, StmtPtr& red_stmt) { red_stmt = nullptr; auto args_list = args->Exprs(); - auto ret_val = c->PushInlineBlock(type); - if ( ret_val ) - ret_val->SetLocationInfo(GetLocationInfo()); loop_over_list(args_list, i) { StmtPtr arg_red_stmt; @@ -2358,6 +2355,10 @@ ExprPtr InlineExpr::Reduce(Reducer* c, StmtPtr& red_stmt) { red_stmt = MergeStmts(red_stmt, arg_red_stmt, assign_stmt); } + auto ret_val = c->PushInlineBlock(type); + if ( ret_val ) + ret_val->SetLocationInfo(GetLocationInfo()); + body = body->Reduce(c); c->PopInlineBlock();