glsl: Avoid calling get_array_element for scalar constants
authorDanylo Piliaiev <danylo.piliaiev@gmail.com>
Mon, 13 Aug 2018 15:57:38 +0000 (18:57 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 15 Aug 2018 07:01:43 +0000 (10:01 +0300)
commit479a849ad606482c3cf67157b77af94ecd450ace
tree87ab1770f59814b205567a0f228d18cde1e9a59d
parentbffa025adaa68c429f86f1736600de7710b21a08
glsl: Avoid calling get_array_element for scalar constants

Accessing scalar constant as an array in function call or
initializer list triggered assert in get_array_element.
Examples:
   func(0[0]);
   vec2 t = { 0[0], 0 };

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107550

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/compiler/glsl/ir_constant_expression.cpp