glsl: Fix null check in read_dereference. 13/7013/1
authorVinson Lee <vlee@freedesktop.org>
Fri, 7 Jun 2013 06:07:30 +0000 (23:07 -0700)
committerVinson Lee <vlee@freedesktop.org>
Fri, 14 Jun 2013 05:13:34 +0000 (22:13 -0700)
Fixes "Logically dead code" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/glsl/ir_reader.cpp

index b366712..51534ca 100644 (file)
@@ -886,7 +886,7 @@ ir_reader::read_dereference(s_expression *expr)
       }
 
       ir_rvalue *idx = read_rvalue(s_index);
-      if (subject == NULL) {
+      if (idx == NULL) {
         ir_read_error(NULL, "when reading the index of an array_ref");
         return NULL;
       }