re PR c/17301 (ICE on wrong usage of __builtin_stdarg_start)
PR c/17301 * builtins.c (expand_builtin_va_start): Check for too few arguments to va_start. testsuite: * gcc.dg/pr17301-1.c: New test. From-SVN: r88835
This commit is contained in:
parent
216a5f1b3f
commit
c69c9b36a9
@ -1,3 +1,9 @@
|
||||
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
PR c/17301
|
||||
* builtins.c (expand_builtin_va_start): Check for too few
|
||||
arguments to va_start.
|
||||
|
||||
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
PR c/17189
|
||||
|
@ -3861,6 +3861,11 @@ expand_builtin_va_start (tree arglist)
|
||||
|
||||
chain = TREE_CHAIN (arglist);
|
||||
|
||||
if (!chain)
|
||||
{
|
||||
error ("too few arguments to function %<va_start%>");
|
||||
return const0_rtx;
|
||||
}
|
||||
if (TREE_CHAIN (chain))
|
||||
error ("too many arguments to function %<va_start%>");
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
PR c/17301
|
||||
* gcc.dg/pr17301-1.c: New test.
|
||||
|
||||
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
|
||||
|
||||
PR c/17189
|
||||
|
11
gcc/testsuite/gcc.dg/pr17301-1.c
Normal file
11
gcc/testsuite/gcc.dg/pr17301-1.c
Normal file
@ -0,0 +1,11 @@
|
||||
/* Invalid use of __builtin_stdarg_start should not cause an ICE. Bug
|
||||
17301. */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "" } */
|
||||
|
||||
int
|
||||
write_format (char *format, ...)
|
||||
{
|
||||
__builtin_va_list p;
|
||||
__builtin_stdarg_start (p); /* { dg-error "error: too few arguments to function 'va_start'" } */
|
||||
}
|
Loading…
Reference in New Issue
Block a user