Skip to content

Commit

Permalink
index: Fix volk_get_index
Browse files Browse the repository at this point in the history
This function results in an infinite loop on Debian 11 for some impls.
This is a first step to fix it.

Fix gnuradio#516

Signed-off-by: Johannes Demel <[email protected]>
  • Loading branch information
jdemel committed Sep 26, 2021
1 parent 602cfdb commit af09827
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/volk_rank_archs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ int volk_get_index(const char* impl_names[], // list of implementations by name
{
unsigned int i;
for (i = 0; i < n_impls; i++) {
if (!strncmp(impl_names[i], impl_name, 20)) {
if (!strncmp(impl_names[i], impl_name, 42)) {
return i;
}
}
// TODO return -1;
// something terrible should happen here
fprintf(stderr, "Volk warning: no arch found, returning generic impl\n");
if (strncmp(impl_name, "generic", 20)){
return -1;
}
return volk_get_index(impl_names, n_impls, "generic"); // but we'll fake it for now
}

Expand Down

0 comments on commit af09827

Please sign in to comment.