aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-12-03 14:57:29 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-12-03 14:57:29 +0100
commit52f2e7e1e986b933049b2ebf98b6004a24a54501 (patch)
tree17bdc749405e3941bea8982fda4b070003f37bc3
parent4a0639a2a934025ee8772a0d23ba5969ccf8a7cf (diff)
downloadgcc-52f2e7e1e986b933049b2ebf98b6004a24a54501.zip
gcc-52f2e7e1e986b933049b2ebf98b6004a24a54501.tar.gz
gcc-52f2e7e1e986b933049b2ebf98b6004a24a54501.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/asan.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a886c04..455420e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ * asan.c (instrument_assignment): Instrument lhs only
+ for gimple_store_p and rhs1 only for gimple_assign_load_p.
+
2012-12-03 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* Makefile.in: Add target mddump, build/genmddump.o. Extend
diff --git a/gcc/asan.c b/gcc/asan.c
index 26c4178..2563a30 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