summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-03 13:57:29 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-03 13:57:29 +0000
commit38e9269e095ed6be02775e4e2bc5ef4631b997bd (patch)
tree17bdc749405e3941bea8982fda4b070003f37bc3 /gcc
parent376b14150dd61999c3a5fa87d34b75aa7a91886b (diff)
downloadgcc-38e9269e095ed6be02775e4e2bc5ef4631b997bd.tar.gz
* asan.c (instrument_assignment): Instrument lhs only
for gimple_store_p and rhs1 only for gimple_assign_load_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194087 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-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 a886c0480cd..455420e672f 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 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