-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn about bogus comparisons #775
Labels
Comments
Hi, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Today, someone filed a bug against our Vulkan driver saying that it hangs when you try to run the following compute shader compiled, I believe, with glslang:
The problem with the shader was that they used an unsigned integer for
i
and a condition ofi >= 0
which always evaluates to true yielding an infinite loop. Since we do nothing in our Vulkan driver to guard against infinite loops (why would we?) they got a GPU hang.It would be really nice if glslang could emit some sort of a warning when someone tries to do an unsafe comparison in a similar way to what GCC does with -Wsign-compare. If it had such a warning, they probably would never have even submitted the bug.
The text was updated successfully, but these errors were encountered: