Skip to content

Commit b90bbdd

Browse files
intrinsic function's body & dependency left unchanged
1 parent 06d2531 commit b90bbdd

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/libasr/asr_scopes.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@ void SymbolTable::mark_all_variables_external(Allocator &al) {
3939
case (ASR::symbolType::Function) : {
4040
ASR::Function_t *v = ASR::down_cast<ASR::Function_t>(a.second);
4141
ASR::FunctionType_t* v_func_type = ASR::down_cast<ASR::FunctionType_t>(v->m_function_signature);
42+
if ((v_func_type->m_abi != ASR::abiType::Intrinsic) &&
43+
(v_func_type->m_abi != ASR::abiType::Interactive)) {
44+
v->m_dependencies = nullptr;
45+
v->n_dependencies = 0;
46+
v->m_body = nullptr;
47+
v->n_body = 0;
48+
}
4249
v_func_type->m_abi = ASR::abiType::Interactive;
43-
v->m_body = nullptr;
44-
v->n_body = 0;
4550
break;
4651
}
4752
case (ASR::symbolType::Module) : {

src/libasr/asr_verify.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,6 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
420420
}
421421

422422
void visit_Function(const Function_t &x) {
423-
ASR::FunctionType_t* v_func_type = ASR::down_cast<ASR::FunctionType_t>(x.m_function_signature);
424-
if (v_func_type->m_abi == abiType::Interactive) {
425-
require(x.n_body == 0,
426-
"The Function::n_body should be 0 if abi set to Interactive");
427-
require(x.m_body == nullptr,
428-
"The Function::m_body should be null if abi set to Interactive");
429-
return;
430-
}
431423
std::vector<std::string> function_dependencies_copy = function_dependencies;
432424
function_dependencies.clear();
433425
function_dependencies.reserve(x.n_dependencies);

0 commit comments

Comments
 (0)