@@ -46,6 +46,7 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
46
46
}
47
47
std::vector<std::string> symbolic_dependencies;
48
48
std::set<ASR::symbol_t *> symbolic_vars_to_free;
49
+ std::set<ASR::symbol_t *> symbolic_vars_to_omit;
49
50
SymEngine_Stack symengine_stack;
50
51
51
52
void visit_Function (const ASR::Function_t &x) {
@@ -94,6 +95,7 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
94
95
func_body.from_pointer_n_copy (al, xx.m_body , xx.n_body );
95
96
96
97
for (ASR::symbol_t * symbol : symbolic_vars_to_free) {
98
+ if (symbolic_vars_to_omit.find (symbol) != symbolic_vars_to_omit.end ()) continue ;
97
99
Vec<ASR::call_arg_t > call_args;
98
100
call_args.reserve (al, 1 );
99
101
ASR::call_arg_t call_arg;
@@ -119,10 +121,10 @@ class ReplaceSymbolicVisitor : public PassUtils::PassVisitor<ReplaceSymbolicVisi
119
121
120
122
ASR::ttype_t *type1 = ASRUtils::TYPE (ASR::make_CPtr_t (al, xx.base .base .loc ));
121
123
xx.m_type = type1;
124
+ symbolic_vars_to_free.insert (ASR::down_cast<ASR::symbol_t >((ASR::asr_t *)&xx));
122
125
if (xx.m_intent == ASR::intentType::In){
123
- return ;
126
+ symbolic_vars_to_omit. insert (ASR::down_cast<ASR:: symbol_t >((ASR:: asr_t *)&xx)) ;
124
127
}
125
- symbolic_vars_to_free.insert (ASR::down_cast<ASR::symbol_t >((ASR::asr_t *)&xx));
126
128
127
129
if (xx.m_intent == ASR::intentType::Local){
128
130
ASR::ttype_t *type2 = ASRUtils::TYPE (ASR::make_Integer_t (al, xx.base .base .loc , 8 ));
0 commit comments