glslang-zig/SPIRV
Mason Remaley 5939e32b87 Fixes undefined behavior due to unspecified enum backing
In C++, enums can only represent "in range" values. If the backing
type is not specified, then the result of using bitwise negation on
an enum is not gaurenteed to be in range, resulting in UB.

This was caught by UBSAN, stack trace is as follows:

0.  0x000000000426e391 in spv::operator& (a=spv::MemoryAccessMaskNone,
    b=(spv::MemoryAccessVolatileMask | spv::MemoryAccessAlignedMask | spv::MemoryAccessNontemporalMask | spv::MemoryAccessMakePointerVisibleMask | spv::MemoryAccessNonPrivatePointerMask | spv::MemoryAccessAliasScopeINTELMaskMask | spv::MemoryAccessNoAliasINTELMaskMask | unknown: 0xfffcffc0)) at SPIRV/spirv.hpp:2804
1.  0x00000000041e81e0 in (anonymous namespace)::TGlslangToSpvTraverser::accessChainLoad (this=0x7fffffffcbb8, type=...) at SPIRV/GlslangToSpv.cpp:5127
2.  0x00000000041bc059 in (anonymous namespace)::TGlslangToSpvTraverser::visitBinary (this=0x7fffffffcbb8, node=0x5f6a6c8) at SPIRV/GlslangToSpv.cpp:2192
3.  0x0000000003db8660 in glslang::TIntermBinary::traverse (this=0x5f6a6c8, it=0x7fffffffcbb8) at glslang/glslang/MachineIndependent/IntermTraverse.cpp:92
4.  0x0000000003db952e in glslang::TIntermAggregate::traverse (this=0x5f6a7d8, it=0x7fffffffcbb8) at glslang/glslang/MachineIndependent/IntermTraverse.cpp:175
5.  0x00000000042082db in (anonymous namespace)::TGlslangToSpvTraverser::makeGlobalInitializers (this=0x7fffffffcbb8, initializers=...) at SPIRV/GlslangToSpv.cpp:5618
6.  0x00000000041c511f in (anonymous namespace)::TGlslangToSpvTraverser::visitAggregate (this=0x7fffffffcbb8, visit=glslang::EvPreVisit, node=0x5f6a9b8) at SPIRV/GlslangToSpv.cpp:2907
7.  0x0000000003db8fb9 in glslang::TIntermAggregate::traverse (this=0x5f6a9b8, it=0x7fffffffcbb8) at glslang/glslang/MachineIndependent/IntermTraverse.cpp:159
8.  0x00000000041acc04 in glslang::GlslangToSpv (intermediate=..., spirv=..., logger=0x7fffffffdc38, options=0x7fffffffdc2f) at SPIRV/GlslangToSpv.cpp:10398
9.  0x0000000003bfd6f1 in CompileAndLinkShaderUnits (compUnits=...) at StandAlone/StandAlone.cpp:1547
10. 0x0000000003bfe2f8 in CompileAndLinkShaderFiles (Worklist=...) at StandAlone/StandAlone.cpp:1640
11. 0x0000000003bfec2c in singleMain () at StandAlone/StandAlone.cpp:1713
12. 0x0000000003bff4dd in main (argc=5, argv=0x7fffffffe3d8) at StandAlone/StandAlone.cpp:1767
2024-07-03 15:59:55 -04:00
..
CInterface Clear spirv vector before generating spirv output 2024-02-14 19:44:34 -05:00
bitutils.h Fix compiler warning emitted from GCC8 2018-09-12 10:34:54 +02:00
CMakeLists.txt Add aliases for the public libraries 2024-06-11 15:34:07 -04:00
disassemble.cpp Fix an issue of getExtBuiltins() 2024-03-22 12:35:30 -04:00
disassemble.h Fix -Wextra-semi warnings in headers used in Chromium 2019-02-21 11:05:21 -05:00
doc.cpp Add support for the ARM extended matrix layout 2024-06-11 15:33:49 -04:00
doc.h Fix some compiler warnings 2023-11-28 19:16:16 -05:00
GLSL.ext.AMD.h Non-functional: Move to latest headers. 2018-03-02 12:36:02 -07:00
GLSL.ext.ARM.h GL_ARM_shader_core_builtins support 2022-12-05 14:15:47 +02:00
GLSL.ext.EXT.h Add support for the ARM extended matrix layout 2024-06-11 15:33:49 -04:00
GLSL.ext.KHR.h Add support for OpExtInstWithForwardRefs 2024-06-06 18:46:14 -04:00
GLSL.ext.NV.h NV_shader_atomic_fp16_vector 2024-02-14 18:55:55 -05:00
GLSL.ext.QCOM.h Support for SPV_QCOM_image_processing2 (#3539) 2024-03-20 18:56:00 -04:00
GLSL.std.450.h [glslang] Strip trailing whitespace 2023-05-22 12:04:40 -06:00
GlslangToSpv.cpp Fix function call line number for calls spanning multiple lines. 2024-07-02 14:38:40 -04:00
GlslangToSpv.h Remove GlslangToSpv.h dependency on SpvTools.h 2023-11-11 08:55:43 -07:00
hex_float.h SPIRV: hex_float: remove workaround for VS2013 2023-05-10 09:55:02 -06:00
InReadableOrder.cpp SPIR-V: Aggressively prune unreachable merge, continue target 2019-10-29 15:33:54 -04:00
Logger.cpp Remove GLSLANG_WEB and GLSLANG_WEB_DEVEL 2023-07-28 11:49:10 -06:00
Logger.h Remove GLSLANG_WEB and GLSLANG_WEB_DEVEL 2023-07-28 11:49:10 -06:00
NonSemanticDebugPrintf.h [glslang] Strip trailing whitespace 2023-05-22 12:04:40 -06:00
NonSemanticShaderDebugInfo100.h [glslang] Strip trailing whitespace 2023-05-22 12:04:40 -06:00
spirv.hpp Fixes undefined behavior due to unspecified enum backing 2024-07-03 15:59:55 -04:00
SpvBuilder.cpp Fill correct file name to OpDebugFunction and add line info for parameters' OpDebugDeclare 2024-07-02 14:23:59 -04:00
SpvBuilder.h Fill correct file name to OpDebugFunction and add line info for parameters' OpDebugDeclare 2024-07-02 14:23:59 -04:00
spvIR.h spirv: Add a postprocessing pass to fix up uses of OpSampledImage 2024-05-20 13:25:55 -04:00
SpvPostProcess.cpp Don't emit duplicate decorations. (#3635) 2024-06-28 19:16:59 -04:00
SPVRemapper.cpp Implement support for GL_KHR_cooperative_matrix extension 2023-07-26 16:39:17 -06:00
SPVRemapper.h Remove SPVRemapper.h dependency on spvIR.h 2023-11-11 08:55:43 -07:00
SpvTools.cpp Remove the name of unused formal paramters 2022-12-09 15:51:35 -05:00
SpvTools.h Remove GlslangToSpv.h dependency on SpvTools.h 2023-11-11 08:55:43 -07:00