From 06d2531d9e818a25b11acfd472905f77a7ee0479 Mon Sep 17 00:00:00 2001 From: Vipul Cariappa Date: Mon, 20 May 2024 20:08:36 +0530 Subject: [PATCH] function verify checks for empty body --- src/libasr/asr_verify.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libasr/asr_verify.cpp b/src/libasr/asr_verify.cpp index 5ad9d27391..62ab9180c6 100644 --- a/src/libasr/asr_verify.cpp +++ b/src/libasr/asr_verify.cpp @@ -422,7 +422,10 @@ class VerifyVisitor : public BaseWalkVisitor void visit_Function(const Function_t &x) { ASR::FunctionType_t* v_func_type = ASR::down_cast(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 function_dependencies_copy = function_dependencies;