aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/lex.cc5
-rw-r--r--libcpp/macro.cc7
3 files changed, 13 insertions, 5 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index e2ed956..353227a 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/118674
+ * macro.cc (parse_params) <case CPP_ELLIPSIS>: If _cpp_save_parameter
+ failed for __VA_ARGS__, goto out.
+
2025-04-04 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/119391
diff --git a/libcpp/lex.cc b/libcpp/lex.cc
index 2d02ce6..e7705a6 100644
--- a/libcpp/lex.cc
+++ b/libcpp/lex.cc
@@ -2711,8 +2711,9 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base)
|| c == '!' || c == '=' || c == ','
|| c == '"' || c == '\''
|| ((c == '$' || c == '@' || c == '`')
- && CPP_OPTION (pfile, cplusplus)
- && CPP_OPTION (pfile, lang) > CLK_CXX23)))
+ && (CPP_OPTION (pfile, cplusplus)
+ ? CPP_OPTION (pfile, lang) > CLK_CXX23
+ : CPP_OPTION (pfile, low_ucns)))))
prefix[prefix_len++] = c;
else
{
diff --git a/libcpp/macro.cc b/libcpp/macro.cc
index aa430e4..be25710 100644
--- a/libcpp/macro.cc
+++ b/libcpp/macro.cc
@@ -3610,9 +3610,10 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *variadic_ptr)
if (!prev_ident)
{
/* An ISO bare ellipsis. */
- _cpp_save_parameter (pfile, nparms,
- pfile->spec_nodes.n__VA_ARGS__,
- pfile->spec_nodes.n__VA_ARGS__);
+ if (!_cpp_save_parameter (pfile, nparms,
+ pfile->spec_nodes.n__VA_ARGS__,
+ pfile->spec_nodes.n__VA_ARGS__))
+ goto out;
nparms++;
pfile->state.va_args_ok = 1;
if (! CPP_OPTION (pfile, c99)