[Bf-blender-cvs] [f23338e] master: Fix limit check before accessing array in opennl
Martin Ettl
noreply at git.blender.org
Wed Jan 21 13:24:29 CET 2015
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",
More information about the Bf-blender-cvs
mailing list