From 866e32ad336f1698809cc03c48f884379d6b39e0 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Tue, 23 Sep 2014 17:59:53 +0000 Subject: [libsanitizer merge from upstream r218156] From-SVN: r215527 --- gcc/asan.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'gcc/asan.c') diff --git a/gcc/asan.c b/gcc/asan.c index 2a90d86..6917950 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -230,6 +230,9 @@ along with GCC; see the file COPYING3. If not see // 1 if it has dynamic initialization, 0 otherwise. uptr __has_dynamic_init; + + // A pointer to struct that contains source location, could be NULL. + __asan_global_source_location *__location; } A destructor function that calls the runtime asan library function @@ -2136,19 +2139,20 @@ asan_dynamic_init_call (bool after_p) const void *__name; const void *__module_name; uptr __has_dynamic_init; + __asan_global_source_location *__location; } type. */ static tree asan_global_struct (void) { - static const char *field_names[6] + static const char *field_names[7] = { "__beg", "__size", "__size_with_redzone", - "__name", "__module_name", "__has_dynamic_init" }; - tree fields[6], ret; + "__name", "__module_name", "__has_dynamic_init", "__location"}; + tree fields[7], ret; int i; ret = make_node (RECORD_TYPE); - for (i = 0; i < 6; i++) + for (i = 0; i < 7; i++) { fields[i] = build_decl (UNKNOWN_LOCATION, FIELD_DECL, @@ -2220,6 +2224,8 @@ asan_add_global (tree decl, tree type, vec *v) int has_dynamic_init = vnode ? vnode->dynamically_initialized : 0; CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE, build_int_cst (uptr, has_dynamic_init)); + CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE, + build_int_cst (uptr, 0)); init = build_constructor (type, vinner); CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init); } -- cgit v1.1