Skip to content
/ bart Public

Commit 08ab54a

Browse files
committed
anaylzer fix
1 parent f559fbf commit 08ab54a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/nlops/stack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ static const struct nlop_s* nlop_stack_container_internal_create(int N, const st
588588
PTR_ALLOC(struct stack_container_s, d);
589589
SET_TYPEID(stack_container_s, d);
590590

591+
assert(0 < N);
591592

592593
int max_DI = 0;
593594
int max_DO = 0;

src/nn/data_list.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ extern const struct nlop_s* nn_batchgen_create(struct bat_gen_conf_s* config, nn
143143
D++;
144144
}
145145

146+
assert(0 < D);
147+
146148
long bat_dims[D][N];
147149
long tot_dims[D][N];
148150
const complex float* data[D];
149151

150-
D = 0;
152+
int d = 0;
151153

152154
for (int i = 0; i < II; i++) {
153155

@@ -164,11 +166,12 @@ extern const struct nlop_s* nn_batchgen_create(struct bat_gen_conf_s* config, nn
164166

165167
md_copy_dims(iov->N, bat_dims[D], iov->dims);
166168
md_copy_dims(tensor->N, tot_dims[D], tensor->dims);
167-
data[D] = tensor->data;
168169

169-
D++;
170+
data[d++] = tensor->data;
170171
}
171172

173+
assert(d == D);
174+
172175
return batch_generator_create(config, D, N, bat_dims, tot_dims, data);
173176
}
174177

0 commit comments

Comments
 (0)