@@ -116,7 +116,8 @@ namespace LCompilers {
116
116
117
117
static inline bool is_aggregate_or_array_type (ASR::expr_t * var) {
118
118
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)));
120
121
}
121
122
122
123
template <class Struct >
@@ -775,7 +776,7 @@ namespace LCompilers {
775
776
}
776
777
777
778
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 *)) {
779
780
if (ASRUtils::get_FunctionType (x)->m_abi == ASR::abiType::BindPython) {
780
781
return ;
781
782
}
@@ -787,7 +788,7 @@ namespace LCompilers {
787
788
* in avoiding deep copies and the destination memory directly gets
788
789
* filled inside the function.
789
790
*/
790
- if ( is_array_or_struct (x->m_return_var )) {
791
+ if ( is_array_or_struct_or_symbolic (x->m_return_var )) {
791
792
for ( auto & s_item: x->m_symtab ->get_scope () ) {
792
793
ASR::symbol_t * curr_sym = s_item.second ;
793
794
if ( curr_sym->type == ASR::symbolType::Variable ) {
@@ -826,7 +827,7 @@ namespace LCompilers {
826
827
for (auto &item : x->m_symtab ->get_scope ()) {
827
828
if (ASR::is_a<ASR::Function_t>(*item.second )) {
828
829
handle_fn_return_var (al, ASR::down_cast<ASR::Function_t>(
829
- item.second ), is_array_or_struct );
830
+ item.second ), is_array_or_struct_or_symbolic );
830
831
}
831
832
}
832
833
}
0 commit comments