diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 43175ffcde8..5541086d55c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2016-10-25 Yao Qi + + PR gdb/20716 + * common/new-op.c (__has_feature): New macro. + Don't override operator new if asan is used. + 2016-10-24 Luis Machado * exec.c (exec_file_locate_attach): Prevent NULL pointer dereference diff --git a/gdb/common/new-op.c b/gdb/common/new-op.c index 5ba4d6e9ca6..f04c5cbbfc0 100644 --- a/gdb/common/new-op.c +++ b/gdb/common/new-op.c @@ -17,6 +17,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* GCC does not understand __has_feature. */ +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif + +#if !__has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__) #include "common-defs.h" #include "host-defs.h" #include @@ -83,3 +89,4 @@ operator new[] (std::size_t sz, const std::nothrow_t&) { return ::operator new (sz, std::nothrow); } +#endif