* c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL and
DECL_IGNORED_P even for non-static compound literals.
* gcc.dg/asan/pr80659.c: New test.
Change-Id: I7565aba65e49836947e0faf2eb5ea668b46a0d87
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@
248143138bc75d-0d04-0410-961f-
82ee72b054a4
+2017-05-17 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/80659
+ * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL and
+ DECL_IGNORED_P even for non-static compound literals.
+
2016-12-21 Jakub Jelinek <jakub@redhat.com>
PR c/77767
DECL_CONTEXT (decl) = current_function_decl;
TREE_USED (decl) = 1;
DECL_READ_P (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
TREE_TYPE (decl) = type;
TREE_READONLY (decl) = (TYPE_READONLY (type)
|| (TREE_CODE (type) == ARRAY_TYPE
set_compound_literal_name (decl);
DECL_DEFER_OUTPUT (decl) = 1;
DECL_COMDAT (decl) = 1;
- DECL_ARTIFICIAL (decl) = 1;
- DECL_IGNORED_P (decl) = 1;
pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
}
PR sanitizer/81111
* g++.dg/ubsan/pr81111.C: New test.
+2017-05-17 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/80659
+ * gcc.dg/asan/pr80659.c: New test.
+
+
2017-04-13 Denis Khalikov <d.khalikov@partner.samsung.com>
PR sanitizer/80414
--- /dev/null
+/* PR sanitizer/80659 */
+/* { dg-do compile } */
+
+void
+foo (int a)
+{
+ switch (a)
+ {
+ case 0:
+ (int[3]) { };
+ int h;
+ }
+}