mesa/src/compiler
Samuel Iglesias Gonsálvez a73a618933 glsl: fix heap-use-after-free in ast_declarator_list::hir()
The get_variable_being_redeclared() function can free 'var' because
a re-declaration of an unsized array variable can establish the size, so
we set the array type to the 'earlier' declaration and free 'var' as it is
not needed anymore.

However, the same 'var' is referenced later in ast_declarator_list::hir().

This patch fixes it by picking the ir_variable_mode from the proper
ir_variable.

This error was detected by Address Sanitizer.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99677
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
2017-02-23 06:56:16 +01:00
..
glsl glsl: fix heap-use-after-free in ast_declarator_list::hir() 2017-02-23 06:56:16 +01:00
nir nir: do not #include util/debug.h within extern C {} 2017-02-21 18:29:17 +00:00
spirv nir: Combine the int and double [un]pack opcodes 2017-02-16 17:28:03 -08:00
.gitignore nir/spirv: Remove a duplicate spirv2nir from .gitignore 2016-10-04 07:43:15 -07:00
Android.glsl.gen.mk Android: glsl: add rules to generate ir_expression*.h header files 2016-09-06 15:58:55 +01:00
Android.glsl.mk android: glsl: build shader cache sources 2017-02-20 16:30:37 +00:00
Android.mk Android: glsl: add rules to generate ir_expression*.h header files 2016-09-06 15:58:55 +01:00
Android.nir.gen.mk compiler: android: flesh out nir into separate makefile 2016-04-11 19:08:23 +01:00
Android.nir.mk android: add SPIRV_FILES to libmesa_nir 2016-11-11 07:59:29 +02:00
builtin_type_macros.h glsl: Add basic ARB_gpu_shader_int64 types 2017-01-20 15:41:23 -08:00
glsl_types.cpp glsl: Add basic ARB_gpu_shader_int64 types 2017-01-20 15:41:23 -08:00
glsl_types.h glsl: Add basic ARB_gpu_shader_int64 types 2017-01-20 15:41:23 -08:00
Makefile.am compiler: avoid warning about redefinition of PYTHON_GEN 2016-10-26 14:54:26 +01:00
Makefile.glsl.am glsl: add initial implementation of shader cache 2017-02-17 11:18:42 +11:00
Makefile.nir.am compiler: avoid warning about redefinition of PYTHON_GEN 2016-10-26 14:54:26 +01:00
Makefile.sources nir: Rename lower_double_pack to lower_64bit_pack 2017-02-16 17:28:03 -08:00
nir_types.cpp nir/types: add C accessors for 64-bit integer types. 2017-02-16 14:10:45 +10:00
nir_types.h nir/types: add C accessors for 64-bit integer types. 2017-02-16 14:10:45 +10:00
SConscript glsl: Generate ir_expression_operation.h from Python 2016-08-30 16:28:00 -07:00
SConscript.glsl mesa: Remove prog_hash_table.c 2016-09-12 10:48:35 +10:00
SConscript.nir glsl: Generate ir_expression_operation.h from Python 2016-08-30 16:28:00 -07:00
shader_enums.c compiler: add missing enums for debug 2017-02-01 15:08:30 +00:00
shader_enums.h mesa: Introduce a compiler enum for tessellation spacing. 2017-01-07 22:22:28 -08:00
shader_info.h compiler: Merge shader_info's tcs and tes structs. 2017-01-10 13:21:21 -08:00