-
Notifications
You must be signed in to change notification settings - Fork 812
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
Undefined behavior in "bitwise operators for mask bit combining" #3485
Comments
The line in question does |
Yes, the problem is inherent in doing bitwise operations on an enum type that is really a bunch of masks. I wonder if switching to spirv.hpp11 would help because then those enums are enum classes based on (Note: Glslang's spirv.hpp is a copy of the original spirv.hpp from the SPIRV-Headers project. It gets copied in on an as needed basis.) Oh, nope. I think that wouldn't help. See https://cplusplus.github.io/CWG/issues/1766.html which says casting a numeric value to an enum type that doesn't have that value is undefined behaviour. So that's interesting... |
Branch based on glslang commit 57d86ab
Some of the bitwise operators for mask combining in SPIRV.hpp create mask values that are outside the valid range of the enum, which apparently is undefined behavior as flagged by the Fuchsia platform build:
The text was updated successfully, but these errors were encountered: