Skip to content
Snippets Groups Projects
Verified Commit b50ddccf authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Fixes weights parsing with DISABLE_DEBUG_FLOAT

It's the name that's NULL when an array isn't found
parent 8cc769ea
No related branches found
No related tags found
No related merge requests found
Pipeline #4006 passed
......@@ -84,14 +84,14 @@ static const void *find_array_entry(const WeightArray *arrays, const char *name)
static const void *find_array_check(const WeightArray *arrays, const char *name, int size) {
const WeightArray *a = find_array_entry(arrays, name);
if (a && a->size == size) return a->data;
if (a->name && a->size == size) return a->data;
else return NULL;
}
static const void *opt_array_check(const WeightArray *arrays, const char *name, int size, int *error) {
const WeightArray *a = find_array_entry(arrays, name);
*error = (a != NULL && a->size != size);
if (a && a->size == size) return a->data;
*error = (a->name != NULL && a->size != size);
if (a->name && a->size == size) return a->data;
else return NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment