|
From: Marcin Ś. <mar...@gm...> - 2014-09-26 20:31:27
|
This bug does not really matter, because overallocation of test_block array.
---
Spotted while looking for "align" macro/function. Not compile tested (it's PPC code path).
---
diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c
index 42d8ce8..e62c359 100644
--- a/coregrind/m_machine.c
+++ b/coregrind/m_machine.c
@@ -476,12 +476,12 @@ static void find_ppc_dcbz_sz(VexArchInfo *arch_info)
Int dcbz_szB = 0;
Int dcbzl_szB;
# define MAX_DCBZL_SZB (128) /* largest known effect of dcbzl */
- char test_block[4*MAX_DCBZL_SZB];
+ char test_block[2*MAX_DCBZL_SZB];
char *aligned = test_block;
Int i;
/* round up to next max block size, assumes MAX_DCBZL_SZB is pof2 */
- aligned = (char *)(((HWord)aligned + MAX_DCBZL_SZB) & ~(MAX_DCBZL_SZB - 1));
+ aligned = (char *)(((HWord)aligned + MAX_DCBZL_SZB - 1) & ~(MAX_DCBZL_SZB - 1));
vg_assert((aligned + MAX_DCBZL_SZB) <= &test_block[sizeof(test_block)]);
/* dcbz often clears 32B, although sometimes whatever the native cache
|