test: fix generate-sym-test using the wrong array

The second check was searching the symbols into the same array, but
using the size of the other. This generated a SIGSEV when they
occassionally mismatched.
This commit is contained in:
Federico Giovanardi
2024-11-15 17:12:42 +01:00
parent be6e599935
commit 55980446c3
+2 -2
View File
@@ -105,9 +105,9 @@ int main(void) {
}
for (j = 0; symbols_from_source[j].name; j++) {
struct symbol*n = bsearch(symbols_from_source+j, symbols_from_source, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback);
struct symbol*n = bsearch(symbols_from_source+j, symbols_from_sym, sizeof(symbols_from_sym)/sizeof(symbols_from_sym[0])-1, sizeof(symbols_from_sym[0]), sort_callback);
if (!n)
printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[i].name);
printf("Found in sources, but not in symbol file: %s\\n", symbols_from_source[j].name);
}
return i == j ? EXIT_SUCCESS : EXIT_FAILURE;