This matches the behavior of field_type() and other get_*_type() methods.

I looked through the calls to element_type() and didn't find a caller that
depends on the old behavior.

Signed-off-by: Fabian Bieler <[email protected]>
---
 src/glsl/glsl_types.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index 31e3dd2..362c970 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -213,12 +213,12 @@ struct glsl_type {
     * Query the type of elements in an array
     *
     * \return
-    * Pointer to the type of elements in the array for array types, or \c NULL
-    * for non-array types.
+    * Pointer to the type of elements in the array for array types, or
+    * \c glsl_type::error_type for non-array types.
     */
    const glsl_type *element_type() const
    {
-      return is_array() ? fields.array : NULL;
+      return is_array() ? fields.array : error_type;
    }
 
    /**
-- 
1.8.1.2

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to