public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix an UBSAN error in cp/parse.c (PR c++/86653).
@ 2018-07-26  8:52 Martin Liška
  2018-07-27 14:25 ` Nathan Sidwell
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2018-07-26  8:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Nathan Sidwell, Jason Merrill

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

Hello.

Quite simple patch that initializes a boolean value before it's used.
The variable is not initialized when an error recovery happens.

Ready for trunk after testing?
Thanks,
Martin

gcc/cp/ChangeLog:

2018-07-26  Martin Liska  <mliska@suse.cz>

        PR c++/86653
	* parser.c (cp_parser_condition): Initialize non_constant_p
        to false.
---
 gcc/cp/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[-- Attachment #2: 0001-Fix-an-UBSAN-error-in-cp-parse.c-PR-c-86653.patch --]
[-- Type: text/x-patch, Size: 441 bytes --]

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))


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix an UBSAN error in cp/parse.c (PR c++/86653).
  2018-07-26  8:52 [PATCH] Fix an UBSAN error in cp/parse.c (PR c++/86653) Martin Liška
@ 2018-07-27 14:25 ` Nathan Sidwell
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Sidwell @ 2018-07-27 14:25 UTC (permalink / raw)
  To: Martin Liška, gcc-patches; +Cc: Jason Merrill

On 07/26/2018 04:52 AM, Martin Liška wrote:
> Hello.
> 
> Quite simple patch that initializes a boolean value before it's used.
> The variable is not initialized when an error recovery happens.
> 
> Ready for trunk after testing?


ok, thanks

nathan

-- 
Nathan Sidwell

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-27 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26  8:52 [PATCH] Fix an UBSAN error in cp/parse.c (PR c++/86653) Martin Liška
2018-07-27 14:25 ` Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).