glslang-zig/glslang
Ben Clayton 5b99b448b3
Fix uninitialized use of TIntermediate::resource (#2424)
TIntermediate was constructed without initializing any of the `resources` fields,
and `TProgram::linkStage()` was not calling `TIntermediate::setLimits()`
after constructing new `TIntermediate`s for non-first stages.

Fields of `resources` were then read in `TIntermediate::finalCheck()`
triggering undefined behavior.

This CL makes three changes:
(1) `TIntermediate::setLimits()` is now called for non-first stages by
    copying the `firstIntermediate`'s limits. This ensures that the
    `resources` fields is initialized, fixing the bug.
(2) `TIntermediate::resources` is now wrapped in a `MustBeAssigned<>`
    helper struct, asserting in non-release builds that this field is
    always initialized before reading.
(3) `TIntermediate::resources` is now zero-initialized, so that if
    the `TIntermediate::resources` field is not set in a release build
    (and so the `assert()` will be disabled) behavior is still
    deterministic.

Fixes #2423
2020-10-19 15:21:12 -06:00
..
CInterface GLSLANG_EXPORT for C APIs. 2020-08-10 22:26:41 +02:00
GenericCodeGen Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
HLSL Remove executable bits from code/data files (#2420) 2020-10-12 10:08:47 -06:00
Include GLSLANG_EXPORT for C APIs. 2020-08-10 22:26:41 +02:00
MachineIndependent Fix uninitialized use of TIntermediate::resource (#2424) 2020-10-19 15:21:12 -06:00
OSDependent License headers: s/Google/The Khronos Group 2020-07-03 12:21:01 +01:00
Public Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
CMakeLists.txt Revert changes that migrate to thread_local. 2020-07-31 07:13:24 +01:00
updateGrammar Revert "Merge pull request #2330 from ShabbyX/optimize_for_angle" 2020-07-13 03:39:08 -06:00