@@ -116,7 +116,8 @@ namespace LCompilers {
116116
117117 static inline bool is_aggregate_or_array_type (ASR::expr_t * var) {
118118 return (ASR::is_a<ASR::Struct_t>(*ASRUtils::expr_type (var)) ||
119- ASRUtils::is_array (ASRUtils::expr_type (var)));
119+ ASRUtils::is_array (ASRUtils::expr_type (var)) ||
120+ ASR::is_a<ASR::SymbolicExpression_t>(*ASRUtils::expr_type (var)));
120121 }
121122
122123 template <class Struct >
@@ -775,7 +776,7 @@ namespace LCompilers {
775776 }
776777
777778 static inline void handle_fn_return_var (Allocator &al, ASR::Function_t *x,
778- bool (*is_array_or_struct )(ASR::expr_t *)) {
779+ bool (*is_array_or_struct_or_symbolic )(ASR::expr_t *)) {
779780 if (ASRUtils::get_FunctionType (x)->m_abi == ASR::abiType::BindPython) {
780781 return ;
781782 }
@@ -787,7 +788,7 @@ namespace LCompilers {
787788 * in avoiding deep copies and the destination memory directly gets
788789 * filled inside the function.
789790 */
790- if ( is_array_or_struct (x->m_return_var )) {
791+ if ( is_array_or_struct_or_symbolic (x->m_return_var )) {
791792 for ( auto & s_item: x->m_symtab ->get_scope () ) {
792793 ASR::symbol_t * curr_sym = s_item.second ;
793794 if ( curr_sym->type == ASR::symbolType::Variable ) {
@@ -834,7 +835,7 @@ namespace LCompilers {
834835 for (auto &item : x->m_symtab ->get_scope ()) {
835836 if (ASR::is_a<ASR::Function_t>(*item.second )) {
836837 handle_fn_return_var (al, ASR::down_cast<ASR::Function_t>(
837- item.second ), is_array_or_struct );
838+ item.second ), is_array_or_struct_or_symbolic );
838839 }
839840 }
840841 }
0 commit comments