diff --git a/SConstruct b/SConstruct index 309d935c3..561ead5ab 100644 --- a/SConstruct +++ b/SConstruct @@ -1857,12 +1857,11 @@ help:always wipe certain freed memory context.Message('%s: checking %s...' % (self.msgprefix, 'whether to use overwrite poisoning')) r = 'overwrite' in self.user_settings.poison context.Result(r) - if r: - context.sconf.Define('DXX_HAVE_POISON_OVERWRITE') + self._define_macro(context, 'DXX_HAVE_POISON_OVERWRITE', int(r)) return r @_custom_test def _check_poison_method(self,context, - _methods=(check_poison_valgrind, check_poison_overwrite), + _methods=(check_poison_overwrite, check_poison_valgrind), poison = None ): # Always run both checks. The user may want a program that diff --git a/common/include/poison.h b/common/include/poison.h index e26c1ceae..0a2a7b5e4 100644 --- a/common/include/poison.h +++ b/common/include/poison.h @@ -32,10 +32,7 @@ template static inline void _DXX_POISON_MEMORY_RANGE(T b, T e, const V &v) { #if DXX_HAVE_POISON - int store = 0; -#ifdef DXX_HAVE_POISON_OVERWRITE - store |= 1; -#endif + int store = DXX_HAVE_POISON_OVERWRITE; #ifdef DXX_HAVE_POISON_VALGRIND if (!store) store |= RUNNING_ON_VALGRIND;