glsl: Fix null check in read_dereference.
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 b3667124fa862b940689948e7a61778d9f368b05..51534ca7c563a185c9cceffeb51e81f69700f63e 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;
       }