Commit: f23338e107503ea9cddaa1e0155556f750c8c15a
Author: Martin Ettl
Date:   Wed Jan 21 17:18:39 2015 +0500
Branches: master
https://developer.blender.org/rBf23338e107503ea9cddaa1e0155556f750c8c15a

Fix limit check before accessing array in opennl

Please note that opennl is already modified (for double precision)
so re-integration is not really easy. Also, we'll eventually switch
to Eigen.

For until that let's just solve the condition in our bundled opennl.

===================================================================

M       intern/opennl/superlu/heap_relax_snode.c
M       intern/opennl/superlu/relax_snode.c

===================================================================

diff --git a/intern/opennl/superlu/heap_relax_snode.c 
b/intern/opennl/superlu/heap_relax_snode.c
index d4b3e22..cd88179 100644
--- a/intern/opennl/superlu/heap_relax_snode.c
+++ b/intern/opennl/superlu/heap_relax_snode.c
@@ -99,7 +99,7 @@ heap_relax_snode (
        }
        j++;
        /* Search for a new leaf */
-       while ( descendants[j] != 0 && j < n ) j++;
+       while ( j < n && descendants[j] != 0 ) j++;
     }
 
 #if ( PRNTlevel>=1 )
diff --git a/intern/opennl/superlu/relax_snode.c 
b/intern/opennl/superlu/relax_snode.c
index 49f6005..4a9265e 100644
--- a/intern/opennl/superlu/relax_snode.c
+++ b/intern/opennl/superlu/relax_snode.c
@@ -66,7 +66,7 @@ relax_snode (
        relax_end[snode_start] = j;             /* Last column is recorded */
        j++;
        /* Search for a new leaf */
-       while ( descendants[j] != 0 && j < n ) j++;
+       while ( j < n && descendants[j] != 0 ) j++;
     }
 
     /*printf("No of relaxed snodes: %d; relaxed columns: %d\n",

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to