@@ -6749,13 +6749,16 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
6749
6749
std::to_string (args.size ()) + " arguments instead." ,
6750
6750
x.base .base .loc );
6751
6751
}
6752
+ const Location &loc = x.base .base .loc ;
6752
6753
ASR::expr_t *var = args[0 ].m_value ;
6753
6754
ASR::expr_t *dim = nullptr ;
6755
+ ASR::ttype_t *int_type = ASRUtils::TYPE (ASR::make_Integer_t (al, loc, 4 , nullptr , 0 ));
6754
6756
if (args.size () == 2 ) {
6755
- dim = args[1 ].m_value ;
6757
+ ASR::expr_t * const_one = ASRUtils::EXPR (make_IntegerConstant_t (al, loc, 1 , int_type));
6758
+ dim = ASRUtils::EXPR (ASR::make_IntegerBinOp_t (al, loc,
6759
+ args[1 ].m_value , ASR::binopType::Add, const_one, int_type, nullptr ));
6756
6760
}
6757
- ASR::ttype_t *int_type = ASRUtils::TYPE (ASR::make_Integer_t (al, x.base .base .loc , 4 , nullptr , 0 ));
6758
- tmp = ASR::make_ArraySize_t (al, x.base .base .loc , var, dim, int_type, nullptr );
6761
+ tmp = ASR::make_ArraySize_t (al, loc, var, dim, int_type, nullptr );
6759
6762
return ;
6760
6763
} else if (call_name == " empty" ) {
6761
6764
// TODO: check that the `empty` arguments are compatible
0 commit comments