OSDN Git Service

glsl: Fix off-by-one error in array size check assertion
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 18 Nov 2015 02:35:00 +0000 (18:35 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 3 Dec 2015 18:43:11 +0000 (18:43 +0000)
commita6be31fc250aae4b4a1711d162dd6957d03884eb
tree81930651cf840fd93d36d596abd84adbf8d402ad
parent895ec179439d3222319da5cbf1e2b8fb102b5dc4
glsl: Fix off-by-one error in array size check assertion

Apparently, this has been a bug since 2010 (c30f6e5d).

Also use ARRAY_SIZE instead of open coding it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 2f554761536bbfd0d8ec22e807c18bd6df0f22b8)
src/glsl/ir.cpp