pan/bi: Fix infinite loop parsing arguments for bifrost_compiler

While char is signed on macOS AArch64, on Linux it is unsigned. This
means it cannot represent the -1 return value of getopt_long.

Change the type of `c` to int, the type that getopt_long returns, so
that the -1 will be kept intact and can be checked for.

Fixes: c6be4f85e3 ("pan/bi: Use getopt for bifrost_compiler")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12153>
This commit is contained in:
Icecream95
2021-07-31 13:21:54 +12:00
committed by Marge Bot
parent 1acc3394c4
commit 490d09f1a4
+1 -1
View File
@@ -252,7 +252,7 @@ disassemble(const char *filename)
int
main(int argc, char **argv)
{
char c;
int c;
if (argc < 2) {
printf("Pass a command\n");