glsl: fix cut-n-paste error in error handling. (v2)
authorDave Airlie <airlied@gmail.com>
Fri, 30 Nov 2012 08:33:21 +0000 (18:33 +1000)
committerDave Airlie <airlied@gmail.com>
Sat, 1 Dec 2012 01:24:16 +0000 (11:24 +1000)
Reported by coverity scan.

v2: fix second case

Note: This is a candidate for stable branches.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/glsl/ir_validate.cpp

index af0b5768ac08a465a5f55d3bf4060935bb5cc5b7..ad57a3149b10fa3cb24d810fdb660676858a8f18 100644 (file)
@@ -120,7 +120,7 @@ ir_visitor_status
 ir_validate::visit_leave(ir_loop *ir)
 {
    if (ir->counter != NULL) {
-      if ((ir->from == NULL) || (ir->from == NULL) || (ir->increment == NULL)) {
+      if ((ir->from == NULL) || (ir->to == NULL) || (ir->increment == NULL)) {
         printf("ir_loop has invalid loop controls:\n"
                "    counter:   %p\n"
                "    from:      %p\n"
@@ -136,7 +136,7 @@ ir_validate::visit_leave(ir_loop *ir)
         abort();
       }
    } else {
-      if ((ir->from != NULL) || (ir->from != NULL) || (ir->increment != NULL)) {
+      if ((ir->from != NULL) || (ir->to != NULL) || (ir->increment != NULL)) {
         printf("ir_loop has invalid loop controls:\n"
                "    counter:   %p\n"
                "    from:      %p\n"