aboutsummaryrefslogtreecommitdiff
path: root/libcpp/charset.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-02-05 20:39:48 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-02-05 20:39:48 +0100
commitb5c1c988528a8761d802e923fe0a94160810c732 (patch)
tree25ec72b899a14342869ac614655061632af0f850 /libcpp/charset.c
parent0fd9d4921f7ba2fc910078dd5271da6e8e1c9e85 (diff)
downloadgcc-b5c1c988528a8761d802e923fe0a94160810c732.zip
gcc-b5c1c988528a8761d802e923fe0a94160810c732.tar.gz
gcc-b5c1c988528a8761d802e923fe0a94160810c732.tar.bz2
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
Diffstat (limited to 'libcpp/charset.c')
-rw-r--r--libcpp/charset.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libcpp/charset.c b/libcpp/charset.c
index 60cbde6..2d07942 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -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,