From f23338e107503ea9cddaa1e0155556f750c8c15a Mon Sep 17 00:00:00 2001 From: Martin Ettl Date: Wed, 21 Jan 2015 17:18:39 +0500 Subject: 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. --- intern/opennl/superlu/heap_relax_snode.c | 2 +- intern/opennl/superlu/relax_snode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'intern/opennl') diff --git a/intern/opennl/superlu/heap_relax_snode.c b/intern/opennl/superlu/heap_relax_snode.c index d4b3e229224..cd88179bbb7 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 49f600533a8..4a9265e0fde 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", -- cgit v1.2.3