diff options
author | Tom de Vries <tom@codesourcery.com> | 2016-09-04 09:07:52 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2016-09-04 09:07:52 +0000 |
commit | 21234eb5e8de8044809c0f2902bdaf217107073f (patch) | |
tree | 77d09f8724bf4c288886104d212a2b0286a1eaa5 /gcc | |
parent | bcfbf31b4014f8533e59018eb3446aeb012e815e (diff) | |
download | gcc-21234eb5e8de8044809c0f2902bdaf217107073f.zip gcc-21234eb5e8de8044809c0f2902bdaf217107073f.tar.gz gcc-21234eb5e8de8044809c0f2902bdaf217107073f.tar.bz2 |
Revert "Replace error_at with assert in build_va_arg"
2016-09-04 Tom de Vries <tom@codesourcery.com>
revert:
2016-08-29 Tom de Vries <tom@codesourcery.com>
* c-common.c (build_va_arg): Replace first argument type error
with assert.
From-SVN: r239975
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 14 |
2 files changed, 20 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 9dc1fdb..7a64140 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,11 @@ +2016-09-04 Tom de Vries <tom@codesourcery.com> + + revert: + 2016-08-29 Tom de Vries <tom@codesourcery.com> + + * c-common.c (build_va_arg): Replace first argument type error + with assert. + 2016-09-02 Jakub Jelinek <jakub@redhat.com> PR c/65467 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 399ba97..1a834a3 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5834,7 +5834,12 @@ build_va_arg (location_t loc, tree expr, tree type) /* Verify that &ap is still recognized as having va_list type. */ tree canon_expr_type = targetm.canonical_va_list_type (TREE_TYPE (expr)); - gcc_assert (canon_expr_type != NULL_TREE); + if (canon_expr_type == NULL_TREE) + { + error_at (loc, + "first argument to %<va_arg%> not of type %<va_list%>"); + return error_mark_node; + } return build_va_arg_1 (loc, type, expr); } @@ -5902,7 +5907,12 @@ build_va_arg (location_t loc, tree expr, tree type) /* Verify that &ap is still recognized as having va_list type. */ tree canon_expr_type = targetm.canonical_va_list_type (TREE_TYPE (expr)); - gcc_assert (canon_expr_type != NULL_TREE); + if (canon_expr_type == NULL_TREE) + { + error_at (loc, + "first argument to %<va_arg%> not of type %<va_list%>"); + return error_mark_node; + } } else { |