Skip to content

Commit b457eb6

Browse files
committed
ASR: Make a dummy assign for exprs
1 parent d51feff commit b457eb6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4729,6 +4729,9 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
47294729
// Visit the statement
47304730
this->visit_stmt(*m_body[i]);
47314731
if (tmp != nullptr) {
4732+
if (ASR::is_a<ASR::expr_t>(*tmp)) {
4733+
tmp = make_dummy_assignment(ASRUtils::EXPR(tmp), tmp->loc);
4734+
}
47324735
ASR::stmt_t* tmp_stmt = ASRUtils::STMT(tmp);
47334736
body.push_back(al, tmp_stmt);
47344737
} else if (!tmp_vec.empty()) {

0 commit comments

Comments
 (0)