diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/gimple-parser.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 5d6c6ef..ac05c3a 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2017-05-11 Mikhail Maltsev <maltsevm@gmail.com> + + PR testsuite/80580 + * gimple-parser.c (c_parser_gimple_unary_expression): Check argument + type of unary '*'. + 2017-05-09 Nathan Sidwell <nathan@acm.org> * c-tree.h (pushdecl): Declare. diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c index 0d6384b..c6c2f7a 100644 --- a/gcc/c/gimple-parser.c +++ b/gcc/c/gimple-parser.c @@ -567,6 +567,11 @@ c_parser_gimple_unary_expression (c_parser *parser) op = c_parser_gimple_postfix_expression (parser); if (op.value == error_mark_node) return ret; + if (! POINTER_TYPE_P (TREE_TYPE (op.value))) + { + error_at (op_loc, "expected pointer as argument of unary %<*%>"); + return ret; + } finish = op.get_finish (); location_t combined_loc = make_location (op_loc, op_loc, finish); ret.value = build_simple_mem_ref_loc (combined_loc, op.value); |