re PR c++/69628 (Conditional jump or move depends on uninitialised value(s) in lex_charconst(cpp_token const*) (c-lex.c:1252))

PR c++/69628
	* charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
	and *UNSIGNEDP if bailing out early due to errors.

	* g++.dg/parse/pr69628.C: New test.

From-SVN: r233186
This commit is contained in:
Jakub Jelinek 2016-02-05 20:39:48 +01:00 committed by Jakub Jelinek
parent 0fd9d4921f
commit b5c1c98852
4 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2016-02-05 Jakub Jelinek <jakub@redhat.com>
PR c++/69628
* g++.dg/parse/pr69628.C: New test.
2016-02-05 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/sancov/asan.c: Move to ...

View File

@ -0,0 +1,5 @@
// PR c++/69628
// { dg-do compile }
0''; // { dg-error "empty character constant" }
// { dg-error "expected unqualified-id before numeric constant" "" { target *-*-* } 4 }

View File

@ -1,3 +1,9 @@
2016-02-05 Jakub Jelinek <jakub@redhat.com>
PR c++/69628
* charset.c (cpp_interpret_charconst): Clear *PCHARS_SEEN
and *UNSIGNEDP if bailing out early due to errors.
2016-01-28 Jakub Jelinek <jakub@redhat.com>
PR pch/68176

View File

@ -1620,10 +1620,17 @@ cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token,
if (token->val.str.len == (size_t) (2 + wide + u8))
{
cpp_error (pfile, CPP_DL_ERROR, "empty character constant");
*pchars_seen = 0;
*unsignedp = 0;
return 0;
}
else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str,
token->type))
{
*pchars_seen = 0;
*unsignedp = 0;
return 0;
}
else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str, token->type))
return 0;
if (wide)
result = wide_str_to_charconst (pfile, str, pchars_seen, unsignedp,