File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2600,7 +2600,8 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
26002600 if (ASRUtils::is_array (type)) {
26012601 std::string size_str = " 1" ;
26022602 out += indent + sym + " ->n_dims = " + std::to_string (x.m_args [i].n_dims ) + " ;\n " ;
2603- for (size_t j=0 ; j<x.m_args [i].n_dims ; j++) {
2603+ std::string stride = " 1" ;
2604+ for (int j = (int )x.m_args [i].n_dims - 1 ; j >= 0 ; j--) {
26042605 std::string st, l;
26052606 if (x.m_args [i].m_dims [j].m_start ) {
26062607 self ().visit_expr (*x.m_args [i].m_dims [j].m_start );
@@ -2619,6 +2620,9 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
26192620 out += st + " ;\n " ;
26202621 out += indent + sym + " ->dims[" + std::to_string (j) + " ].length = " ;
26212622 out += l + " ;\n " ;
2623+ out += indent + sym + " ->dims[" + std::to_string (j) + " ].stride = " ;
2624+ out += stride + " ;\n " ;
2625+ stride = " (" + stride + " * " + l + " )" ;
26222626 }
26232627 std::string ty = CUtils::get_c_type_from_ttype_t (
26242628 ASRUtils::type_get_past_array (
You can’t perform that action at this time.
0 commit comments