gcc/ChangeLog:
2014-09-19 Marat Zakirov <m.zakirov@samsung.com>
* asan.c (instrument_derefs): BIT_FIELD_REF added.
gcc/testsuite/ChangeLog:
2014-09-19 Marat Zakirov <m.zakirov@samsung.com>
* c-c++-common/asan/bitfield-5.c: New test.
From-SVN: r216144
+2014-10-13 Marat Zakirov <m.zakirov@samsung.com>
+
+ * asan.c (instrument_derefs): BIT_FIELD_REF added.
+
2014-10-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/63419
case INDIRECT_REF:
case MEM_REF:
case VAR_DECL:
+ case BIT_FIELD_REF:
break;
/* FALLTHRU */
default:
+2014-09-19 Marat Zakirov <m.zakirov@samsung.com>
+
+ * c-c++-common/asan/bitfield-5.c: New test.
+
2014-10-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/63419
--- /dev/null
+/* Check BIT_FIELD_REF. */
+
+/* { dg-do run } */
+/* { dg-shouldfail "asan" } */
+
+struct A
+{
+ int y : 20;
+ int x : 13;
+};
+
+int __attribute__ ((noinline, noclone))
+f (void *p) {
+ return ((struct A *)p)->x != 0;
+}
+
+int
+main ()
+{
+ int a = 0;
+ return f (&a);
+}
+
+/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow" } */