diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-09-05 14:57:01 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-09-05 16:49:18 +0200 |
commit | 55243898f8f9560371f258fe0c6ca202ab7b2085 (patch) | |
tree | 3c04ab611bd84e24dc7b7b1915f69be2e3e636cf /gcc/c | |
parent | b7f474517092b0ed6fd7af0690900d15c8c073f8 (diff) | |
download | gcc-55243898f8f9560371f258fe0c6ca202ab7b2085.zip gcc-55243898f8f9560371f258fe0c6ca202ab7b2085.tar.gz gcc-55243898f8f9560371f258fe0c6ca202ab7b2085.tar.bz2 |
OpenMP: Avoid ICE in c_parser_omp_clause_allocate with invalid expr
gcc/c/ChangeLog:
* c-parser.cc (c_parser_omp_clause_allocate): Handle
error_mark_node.
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/allocate-13.c: New test.
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/c-parser.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index cae10ba..c8d285f 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -16676,7 +16676,9 @@ c_parser_omp_clause_allocate (c_parser *parser, tree list) location_t expr_loc = c_parser_peek_token (parser)->location; c_expr expr = c_parser_expr_no_commas (parser, NULL); expr = convert_lvalue_to_rvalue (expr_loc, expr, false, true); - if (strcmp (p, "allocator") == 0) + if (expr.value == error_mark_node) + ; + else if (strcmp (p, "allocator") == 0) { allocator = expr.value; allocator = c_fully_fold (allocator, false, NULL); |