From f96afd94b00ee2500ad66fd532a7921d95dc4c82 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 1 Oct 2017 01:06:39 +0200 Subject: [PATCH 1/2] Fix out-of-bounds accesses where the data should be zero anyway --- kernel/generic/ztrmm_utcopy_8.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kernel/generic/ztrmm_utcopy_8.c b/kernel/generic/ztrmm_utcopy_8.c index 6c0448443..24043d8e8 100644 --- a/kernel/generic/ztrmm_utcopy_8.c +++ b/kernel/generic/ztrmm_utcopy_8.c @@ -828,11 +828,17 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON b[ 0] = ONE; b[ 1] = ZERO; #else - b[ 0] = *(a01 + 0); - b[ 1] = *(a01 + 1); +// out-of-bounds memory accesses, see issue 601 +// b[ 0] = *(a01 + 0); +// b[ 1] = *(a01 + 1); + b[0]=ZERO; + b[1]=ZERO; #endif - b[ 2] = *(a02 + 0); - b[ 3] = *(a02 + 1); +// out-of-bounds memory accesses, see issue 601 +// b[ 2] = *(a02 + 0); +// b[ 3] = *(a02 + 1); + b[2]=ZERO; + b[3]=ZERO; b += 4; } posY += 2; From 9d92f526dd0995d06933a47111c9b7c6cad3ed26 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 6 Oct 2017 23:51:32 +0200 Subject: [PATCH 2/2] Comment out a code block that performs out-of-bounds memory accesses ...and does not appear to be needed even when it stays within the bounds of the array --- kernel/generic/ztrmm_utcopy_8.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/kernel/generic/ztrmm_utcopy_8.c b/kernel/generic/ztrmm_utcopy_8.c index 24043d8e8..fb286d0e6 100644 --- a/kernel/generic/ztrmm_utcopy_8.c +++ b/kernel/generic/ztrmm_utcopy_8.c @@ -823,24 +823,22 @@ int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLON b[ 3] = *(a01 + 3); b += 4; } - } else { +#if 1 + } +#else + } else { #ifdef UNIT b[ 0] = ONE; b[ 1] = ZERO; #else -// out-of-bounds memory accesses, see issue 601 -// b[ 0] = *(a01 + 0); -// b[ 1] = *(a01 + 1); - b[0]=ZERO; - b[1]=ZERO; + b[ 0] = *(a01 + 0); + b[ 1] = *(a01 + 1); #endif -// out-of-bounds memory accesses, see issue 601 -// b[ 2] = *(a02 + 0); -// b[ 3] = *(a02 + 1); - b[2]=ZERO; - b[3]=ZERO; + b[ 2] = *(a02 + 0); + b[ 3] = *(a02 + 1); b += 4; } +#endif posY += 2; }