Skip to content

Commit

Permalink
function verify checks for empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
Vipul-Cariappa committed May 20, 2024
1 parent 0fd64bd commit 06d2531
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libasr/asr_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
void visit_Function(const Function_t &x) {
ASR::FunctionType_t* v_func_type = ASR::down_cast<ASR::FunctionType_t>(x.m_function_signature);
if (v_func_type->m_abi == abiType::Interactive) {
// This function would have been verified in the previous interactive pass
require(x.n_body == 0,
"The Function::n_body should be 0 if abi set to Interactive");
require(x.m_body == nullptr,
"The Function::m_body should be null if abi set to Interactive");
return;
}
std::vector<std::string> function_dependencies_copy = function_dependencies;
Expand Down

0 comments on commit 06d2531

Please sign in to comment.