diff options
author | Marek Polacek <polacek@redhat.com> | 2015-10-07 14:09:05 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-10-07 14:09:05 +0000 |
commit | b850dd2f0b0c10067114eb0320b167be2ac87d6c (patch) | |
tree | 36e65db888823805e4724e7395b5e54da6071099 /gcc | |
parent | 1f3ccbc8e54b83e0d068eec310915892440a97fc (diff) | |
download | gcc-b850dd2f0b0c10067114eb0320b167be2ac87d6c.zip gcc-b850dd2f0b0c10067114eb0320b167be2ac87d6c.tar.gz gcc-b850dd2f0b0c10067114eb0320b167be2ac87d6c.tar.bz2 |
re PR sanitizer/67867 (UBSan bootstrap fails with error: ‘otype’ may be used uninitialized in this function [-Werror=maybe-uninitialized])
PR sanitizer/67867
* search.c (accessible_p): Initialize OTYPE to NULL_TREE.
From-SVN: r228569
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/search.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3c78545..d465ef6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2015-10-07 Marek Polacek <polacek@redhat.com> + PR sanitizer/67867 + * search.c (accessible_p): Initialize OTYPE to NULL_TREE. + +2015-10-07 Marek Polacek <polacek@redhat.com> + * cp-gimplify.c (genericize_if_stmt): Use protected_set_expr_location. (genericize_cp_loop): Likewise. * decl.c (cxx_maybe_build_cleanup): Likewise. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 508e66c..56bb266 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -961,7 +961,7 @@ accessible_p (tree type, tree decl, bool consider_local_p) && (!processing_template_parmlist || processing_template_decl > 1)) return 1; - tree otype; + tree otype = NULL_TREE; if (!TYPE_P (type)) { /* When accessing a non-static member, the most derived type in the |