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 @@ -2569,7 +2569,8 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
2569
2569
if (ASRUtils::is_array (type)) {
2570
2570
std::string size_str = " 1" ;
2571
2571
out += indent + sym + " ->n_dims = " + std::to_string (x.m_args [i].n_dims ) + " ;\n " ;
2572
- for (size_t j=0 ; j<x.m_args [i].n_dims ; j++) {
2572
+ std::string stride = " 1" ;
2573
+ for (int j = (int )x.m_args [i].n_dims - 1 ; j >= 0 ; j--) {
2573
2574
std::string st, l;
2574
2575
if (x.m_args [i].m_dims [j].m_start ) {
2575
2576
self ().visit_expr (*x.m_args [i].m_dims [j].m_start );
@@ -2588,6 +2589,9 @@ PyMODINIT_FUNC PyInit_lpython_module_)" + fn_name + R"((void) {
2588
2589
out += st + " ;\n " ;
2589
2590
out += indent + sym + " ->dims[" + std::to_string (j) + " ].length = " ;
2590
2591
out += l + " ;\n " ;
2592
+ out += indent + sym + " ->dims[" + std::to_string (j) + " ].stride = " ;
2593
+ out += stride + " ;\n " ;
2594
+ stride = " (" + stride + " * " + l + " )" ;
2591
2595
}
2592
2596
std::string ty = CUtils::get_c_type_from_ttype_t (
2593
2597
ASRUtils::type_get_past_array (
You can’t perform that action at this time.
0 commit comments