From 5dbc3940fcd15ff477eb556630734017dd2b0cff Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 31 Jul 2018 12:32:13 +0200 Subject: [PATCH] Fix an UBSAN error in cp/parse.c (PR c++/86653). 2018-07-31 Martin Liska PR c++/86653 * parser.c (cp_parser_condition): Initialize non_constant_p to false. From-SVN: r263110 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d3b3cc2be6c..128360794e8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-07-31 Martin Liska + + PR c++/86653 + * parser.c (cp_parser_condition): Initialize non_constant_p + to false. + 2018-07-28 David Malcolm * error.c (cp_printer): In the leading comment, move "%H" and "%I" diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d44a6b88028..93c812f80d7 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -11721,7 +11721,7 @@ cp_parser_condition (cp_parser* parser) if (cp_parser_parse_definitely (parser)) { tree pushed_scope; - bool non_constant_p; + bool non_constant_p = false; int flags = LOOKUP_ONLYCONVERTING; if (!cp_parser_check_condition_declarator (parser, declarator, loc)) -- 2.30.2