glslang-zig/SPIRV
craig stout d0e7ed37fc
[spirv-remap] Fix undefined behavior in hashing (#2403)
There's a statement that intends to generate a 32-bit hashcode, but due
to integer promotion, the intermediate values can trigger signed integer
overflow, which is undefined behavior.

To avoid this, cast at least one operand to unsigned int before
multiplying, which will cause the result to be promoted to unsigned int
instead of signed int.

With this patch, I'm able to build core for qemu-x64 with host_asan-ubsan.

Fixed: 60128
Change-Id: Idd644e534116bf29dca8013936ac39901bbe68fc
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/glslang/+/428254
Reviewed-by: John Bauman <jbauman@google.com>

Co-authored-by: Drew Fisher <zarvox@google.com>
2020-09-26 18:43:30 -06:00
..
CInterface GLSLANG_EXPORT for C APIs. 2020-08-10 22:26:41 +02:00
bitutils.h Fix compiler warning emitted from GCC8 2018-09-12 10:34:54 +02:00
CMakeLists.txt Revert changes that migrate to thread_local. 2020-07-31 07:13:24 +01:00
disassemble.cpp SPIRV: Add disassembly support for multiple literal strings (#2397) 2020-09-14 09:57:09 -06:00
disassemble.h Fix -Wextra-semi warnings in headers used in Chromium 2019-02-21 11:05:21 -05:00
doc.cpp SPIRV: Add disassembly support for multiple literal strings (#2397) 2020-09-14 09:57:09 -06:00
doc.h SPIRV: Add disassembly support for multiple literal strings (#2397) 2020-09-14 09:57:09 -06:00
GLSL.ext.AMD.h Non-functional: Move to latest headers. 2018-03-02 12:36:02 -07:00
GLSL.ext.EXT.h Add changes for SPV_EXT_shader_atomic_float_add 2020-07-22 05:52:22 -07:00
GLSL.ext.KHR.h GL_EXT_ray_query updates 2020-03-19 16:46:30 -04:00
GLSL.ext.NV.h Add support for GL_NV_shader_sm_builtins 2019-06-08 08:53:11 -04:00
GLSL.std.450.h Remove execute permissions 2018-08-07 03:16:20 +09:00
GlslangToSpv.cpp Fix #2366, fix #2358, correctly separate out numerical feature checking 2020-08-14 08:40:06 -06:00
GlslangToSpv.h Fix #2007: Fix a couple relative header paths in header files. 2019-12-09 03:12:10 -07:00
hex_float.h bitwise on boolean 2020-03-30 01:32:23 +03:00
InReadableOrder.cpp SPIR-V: Aggressively prune unreachable merge, continue target 2019-10-29 15:33:54 -04:00
Logger.cpp Make file formatting comply with POSIX and Unix standards 2020-03-21 03:20:25 -04:00
Logger.h Web: Remove unused stage functionality, SPIR-V logger, and hex_utils 2019-08-20 23:21:56 -06:00
NonSemanticDebugPrintf.h GL_EXT_debug_printf implementation 2020-03-05 13:41:34 -06:00
spirv.hpp SPV: Update to the latest SPIR-V headers. 2020-07-21 21:05:25 -06:00
SpvBuilder.cpp SPIRV: Add more utility functions to build some opcodes (#2398) 2020-09-18 07:18:35 -06:00
SpvBuilder.h SPIRV: Add more utility functions to build some opcodes (#2398) 2020-09-18 07:18:35 -06:00
spvIR.h SPV: RelaxedPrecision: Generalize fix #2293 to cover more operations. 2020-06-30 02:44:52 -06:00
SpvPostProcess.cpp SPIR-V postprocessing: WEB case only needs CFG mods 2019-11-07 17:55:22 -05:00
SPVRemapper.cpp [spirv-remap] Fix undefined behavior in hashing (#2403) 2020-09-26 18:43:30 -06:00
SPVRemapper.h Remove extraneous semicolons 2019-06-25 13:20:16 -04:00
SpvTools.cpp SPV: Use more correct SPV-Tools environment, partially addressing #2290 2020-08-04 03:00:32 -06:00
SpvTools.h Add -g0 command line argument 2020-06-18 10:16:40 -04:00