Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Mar 17, 2021
1 parent e6a0265 commit 06109de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lfortran/semantics/ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ class BodyVisitor : public AST::BaseVisitor<BodyVisitor>
ASR::symbol_t *sym = resolve_subroutine(x.base.base.loc, x.m_name);
Vec<ASR::expr_t*> args = visit_expr_list(x.m_args, x.n_args);
ASR::Subroutine_t *sub;
ASR::symbol_t *generic_procedure = nullptr;
ASR::symbol_t *original_name = nullptr;
switch (sym->type) {
case (ASR::symbolType::Subroutine) : {
sub = ASR::down_cast<ASR::Subroutine_t>(sym);
Expand All @@ -1099,15 +1099,15 @@ class BodyVisitor : public AST::BaseVisitor<BodyVisitor>
ASR::GenericProcedure_t *p = ASR::down_cast<ASR::GenericProcedure_t>(sym);
int idx = select_generic_procedure(args, *p, x.base.base.loc);
sub = ASR::down_cast<ASR::Subroutine_t>(p->m_procs[idx]);
generic_procedure = sym;
original_name = sym;
break;
}
default : {
throw SemanticError("Symbol type not supported", x.base.base.loc);
}
}
tmp = ASR::make_SubroutineCall_t(al, x.base.base.loc,
(ASR::symbol_t*)sub, generic_procedure, args.p, args.size());
(ASR::symbol_t*)sub, original_name, args.p, args.size());
}

int select_generic_procedure(const Vec<ASR::expr_t*> &args,
Expand Down Expand Up @@ -1531,7 +1531,7 @@ class BodyVisitor : public AST::BaseVisitor<BodyVisitor>
LFORTRAN_ASSERT(f2);
type = EXPR2VAR(ASR::down_cast<ASR::Function_t>(f2)->m_return_var)->m_type;
tmp = ASR::make_FuncCall_t(al, x.base.base.loc,
f2, nullptr, args.p, args.size(), nullptr, 0, type);
f2, v, args.p, args.size(), nullptr, 0, type);
break;
}
case (ASR::symbolType::Variable) : {
Expand Down

0 comments on commit 06109de

Please sign in to comment.