@@ -8645,31 +8645,24 @@ we will have to use something else.
86458645 } else {
86468646 const Location& loc = x.base .base .loc ;
86478647 ASR::ttype_t * el_type = ASRUtils::type_get_past_array (
8648- ASRUtils::type_get_past_allocatable_pointer (type));
8649- if ( !ASRUtils::is_struct (*el_type) ) {
8650- ASR::expr_t * zero = ASRUtils::get_constant_zero_with_given_type (al, el_type);
8651- LCOMPILERS_ASSERT (assign_asr_target)
8652- ASRUtils::make_ArrayBroadcast_t_util (al, x.base .base .loc , assign_asr_target, zero);
8653- tmp = &(zero->base );
8654- } else {
8655- ASR::expr_t * zero = ASRUtils::get_constant_zero_with_given_type (al, int32);
8656- LCOMPILERS_ASSERT (assign_asr_target)
8657- size_t rank = ASRUtils::extract_n_dims_from_ttype (type);
8658- Vec<ASR::array_index_t > array_index; array_index.reserve (al, rank);
8659- for ( size_t i = 0 ; i < rank; i++ ) {
8660- ASR::array_index_t idx;
8661- idx.loc = loc;
8662- idx.m_left = nullptr ;
8663- idx.m_right = zero;
8664- idx.m_step = nullptr ;
8665- array_index.push_back (al, idx);
8666- }
8667- ASR::expr_t * arrayitem = ASRUtils::EXPR (ASR::make_ArrayItem_t (
8668- al, loc, assign_asr_target, array_index.p , array_index.size (),
8669- el_type, ASR::arraystorageType::RowMajor, nullptr ));
8670- ASRUtils::make_ArrayBroadcast_t_util (al, x.base .base .loc , assign_asr_target, arrayitem);
8671- tmp = &(arrayitem->base );
8648+ ASRUtils::type_get_past_allocatable_pointer (type));
8649+ ASR::expr_t * zero = ASRUtils::get_constant_zero_with_given_type (al, int32);
8650+ LCOMPILERS_ASSERT (assign_asr_target)
8651+ size_t rank = ASRUtils::extract_n_dims_from_ttype (type);
8652+ Vec<ASR::array_index_t > array_index; array_index.reserve (al, rank);
8653+ for ( size_t i = 0 ; i < rank; i++ ) {
8654+ ASR::array_index_t idx;
8655+ idx.loc = loc;
8656+ idx.m_left = nullptr ;
8657+ idx.m_right = zero;
8658+ idx.m_step = nullptr ;
8659+ array_index.push_back (al, idx);
86728660 }
8661+ ASR::expr_t * arrayitem = ASRUtils::EXPR (ASR::make_ArrayItem_t (
8662+ al, loc, assign_asr_target, array_index.p , array_index.size (),
8663+ el_type, ASR::arraystorageType::RowMajor, nullptr ));
8664+ ASRUtils::make_ArrayBroadcast_t_util (al, x.base .base .loc , assign_asr_target, arrayitem);
8665+ tmp = &(arrayitem->base );
86738666 }
86748667 return ;
86758668 } else if (call_name == " c_p_pointer" ) {
0 commit comments