From 52f2e7e1e986b933049b2ebf98b6004a24a54501 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 3 Dec 2012 14:57:29 +0100 Subject: [PATCH] asan.c (instrument_assignment): Instrument lhs only for gimple_store_p and rhs1 only for gimple_assign_load_p. * asan.c (instrument_assignment): Instrument lhs only for gimple_store_p and rhs1 only for gimple_assign_load_p. From-SVN: r194087 --- gcc/ChangeLog | 5 +++++ gcc/asan.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a886c0480cd..455420e672f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-12-03 Jakub Jelinek + + * asan.c (instrument_assignment): Instrument lhs only + for gimple_store_p and rhs1 only for gimple_assign_load_p. + 2012-12-03 Michael Zolotukhin * Makefile.in: Add target mddump, build/genmddump.o. Extend diff --git a/gcc/asan.c b/gcc/asan.c index 26c4178a9f0..2563a305b20 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1339,10 +1339,12 @@ instrument_assignment (gimple_stmt_iterator *iter) gcc_assert (gimple_assign_single_p (s)); - instrument_derefs (iter, gimple_assign_lhs (s), - gimple_location (s), true); - instrument_derefs (iter, gimple_assign_rhs1 (s), - gimple_location (s), false); + if (gimple_store_p (s)) + instrument_derefs (iter, gimple_assign_lhs (s), + gimple_location (s), true); + if (gimple_assign_load_p (s)) + instrument_derefs (iter, gimple_assign_rhs1 (s), + gimple_location (s), false); } /* Instrument the function call pointed to by the iterator ITER, if it