glslang-zig/glslang/MachineIndependent
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
..
preprocessor Remove executable bits from code/data files (#2420) 2020-10-12 10:08:47 -06:00
attribute.cpp Web: Turn off bracket-style attributes, reflection, and IO mapping. 2019-08-20 23:21:55 -06:00
attribute.h HLSL: Fix #1912: add attribute syntax for nonreadable/nonwritable 2019-09-29 19:16:25 -06:00
Constant.cpp Copyright update, mostly to trigger bots again. 2020-03-01 04:51:40 -07:00
gl_types.h Preprocessor related issue fix (#2378) 2020-09-14 21:46:24 -06:00
glslang.m4 Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
glslang.y Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
glslang_tab.cpp Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
glslang_tab.cpp.h Non-functional: correctly do GL_EXT_buffer_reference2 semantic checking 2020-08-07 02:26:04 -06:00
InfoSink.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
Initialize.cpp Allow subpassLoad for ANGLE 2020-09-11 22:30:49 -04:00
Initialize.h Comment out params instead of removing 2019-09-11 08:59:47 -04:00
Intermediate.cpp Remove executable bits from code/data files (#2420) 2020-10-12 10:08:47 -06:00
intermOut.cpp Fix #2366, fix #2358, correctly separate out numerical feature checking 2020-08-14 08:40:06 -06:00
IntermTraverse.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
iomapper.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
iomapper.h Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
limits.cpp Web: Turn off includes, independent preprocessing path, fine tune all. 2019-08-20 23:21:56 -06:00
linkValidate.cpp Fix uninitialized use of TIntermediate::resource (#2424) 2020-10-19 15:21:12 -06:00
LiveTraverser.h also search global variables assignment for live variables 2020-07-20 18:43:00 -04:00
localintermediate.h Fix uninitialized use of TIntermediate::resource (#2424) 2020-10-19 15:21:12 -06:00
parseConst.cpp Fix MSVC build issue - remove invalid character 2020-03-19 15:31:31 -06:00
ParseContextBase.cpp Error assigns to objects of rayQueryEXT type. 2020-03-30 10:24:30 -07:00
ParseHelper.cpp Preprocessor related issue fix (#2378) 2020-09-14 21:46:24 -06:00
ParseHelper.h Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
parseVersions.h Fix #2366, fix #2358, correctly separate out numerical feature checking 2020-08-14 08:40:06 -06:00
pch.h Use precompiled headers for some glslang projects 2018-10-31 15:38:08 -05:00
PoolAlloc.cpp Revert changes that migrate to thread_local. 2020-07-31 07:13:24 +01:00
propagateNoContraction.cpp Make file formatting comply with POSIX and Unix standards 2020-03-21 03:20:25 -04:00
propagateNoContraction.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
reflection.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
reflection.h Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
RemoveTree.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
RemoveTree.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
Scan.cpp Revert "Merge pull request #2330 from ShabbyX/optimize_for_angle" 2020-07-13 03:39:08 -06:00
Scan.h SPV: Fix #1575, fix #1593: Support HLSL #line 2018-12-07 17:36:33 -07:00
ScanContext.h GL_EXT_buffer_reference 2019-01-07 12:36:13 -06:00
ShaderLang.cpp Fix uninitialized use of TIntermediate::resource (#2424) 2020-10-19 15:21:12 -06:00
SymbolTable.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
SymbolTable.h Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
Versions.cpp Parser: Fix wrong names of extension macros 2020-09-02 23:03:03 +08:00
Versions.h Add changes for SPV_EXT_shader_atomic_float_add 2020-07-22 05:52:22 -07:00