Skip to content

Commit 1f60cf0

Browse files
Use the Block symbol from the current scope.
1 parent 7d78dba commit 1f60cf0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libasr/pass/inline_function_calls.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ class InlineFunctionCallVisitor : public PassUtils::PassVisitor<InlineFunctionCa
339339
for( size_t i = 0; i < func->n_body && success; i++ ) {
340340
node_duplicator.success = true;
341341
ASR::stmt_t* m_body_copy = node_duplicator.duplicate_stmt(func->m_body[i]);
342+
if (ASR::is_a<ASR::BlockCall_t>(*m_body_copy)){
343+
ASR::BlockCall_t *bc = ASR::down_cast<ASR::BlockCall_t>(m_body_copy);
344+
std::string block_name = ASRUtils::symbol_name(bc->m_m);
345+
LCOMPILERS_ASSERT(current_scope->get_symbol(block_name))
346+
bc->m_m = current_scope->get_symbol(block_name);
347+
}
342348
if( node_duplicator.success ) {
343349
func_copy.push_back(al, m_body_copy);
344350
} else {

0 commit comments

Comments
 (0)