mirror of git://gcc.gnu.org/git/gcc.git
[PR 87347] Prevent segfaults if TYPE_ARG_TYPES is NULL
2018-09-26 Martin Jambor <mjambor@suse.cz>
PR c/87347
c/
* c-parser.c (warn_for_abs): Bail out if TYPE_ARG_TYPES is NULL. Fix
comment.
testsuite/
* gcc.dg/pr87347.c: New test.
From-SVN: r264640
This commit is contained in:
parent
6fe0c58b9f
commit
ce6f088889
|
|
@ -1,3 +1,9 @@
|
||||||
|
2018-09-26 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
PR c/87347
|
||||||
|
* c-parser.c (warn_for_abs): Bail out if TYPE_ARG_TYPES is NULL. Fix
|
||||||
|
comment.
|
||||||
|
|
||||||
2018-09-17 David Malcolm <dmalcolm@redhat.com>
|
2018-09-17 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
* c-objc-common.c (range_label_for_type_mismatch::get_text):
|
* c-objc-common.c (range_label_for_type_mismatch::get_text):
|
||||||
|
|
|
||||||
|
|
@ -9102,8 +9102,8 @@ sizeof_ptr_memacc_comptypes (tree type1, tree type2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Warn for patterns where abs-like function appears to be used incorrectly,
|
/* Warn for patterns where abs-like function appears to be used incorrectly,
|
||||||
gracely ignore any non-abs-like function. The warning location should be
|
gracefully ignore any non-abs-like function. The warning location should
|
||||||
LOC. FNDECL is the declaration of called function, it must be a
|
be LOC. FNDECL is the declaration of called function, it must be a
|
||||||
BUILT_IN_NORMAL function. ARG is the first and only argument of the
|
BUILT_IN_NORMAL function. ARG is the first and only argument of the
|
||||||
call. */
|
call. */
|
||||||
|
|
||||||
|
|
@ -9223,6 +9223,9 @@ warn_for_abs (location_t loc, tree fndecl, tree arg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!TYPE_ARG_TYPES (TREE_TYPE (fndecl)))
|
||||||
|
return;
|
||||||
|
|
||||||
tree ftype = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
|
tree ftype = TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
|
||||||
if (TREE_CODE (atype) == COMPLEX_TYPE)
|
if (TREE_CODE (atype) == COMPLEX_TYPE)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2018-09-26 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
PR c/87347
|
||||||
|
* gcc.dg/pr87347.c: New test.
|
||||||
|
|
||||||
2018-09-26 Paolo Carlini <paolo.carlini@oracle.com>
|
2018-09-26 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
PR c++/71131
|
PR c++/71131
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
/* {dg-do compile} */
|
||||||
|
/* { dg-options "-Wabsolute-value" } */
|
||||||
|
|
||||||
|
int a;
|
||||||
|
int abs();
|
||||||
|
void b() { abs(a); }
|
||||||
Loading…
Reference in New Issue