Commit f9e1917e by Joseph Myers Committed by Joseph Myers

re PR c/3259 (({ }) and -Wall)

	* c-common.c (verify_tree): Check for x being NULL.
	* doc/c-tree.texi: Document COMPOUND_BODY of an empty
	COMPOUND_STMT.
	Fixes PR c/3259.

testsuite:
	* gcc.dg/20010622-1.c: New test.

From-SVN: r43508
parent 9e2f7ec7
2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (verify_tree): Check for x being NULL.
* doc/c-tree.texi: Document COMPOUND_BODY of an empty
COMPOUND_STMT.
Fixes PR c/3259.
2001-06-22 DJ Delorie <dj@redhat.com>
* config/arm/arm.h (struct machine_function): Remove ra_rtx.
......
......@@ -1592,6 +1592,11 @@ verify_tree (x, pbefore_sp, pno_sp, writer)
enum tree_code code;
char class;
/* X may be NULL if it is the operand of an empty statement expression
({ }). */
if (x == NULL)
return;
restart:
code = TREE_CODE (x);
class = TREE_CODE_CLASS (code);
......
......@@ -1473,6 +1473,8 @@ should be run in the reverse order of the order in which the associated
Used to represent a brace-enclosed block. The first substatement is
given by @code{COMPOUND_BODY}. Subsequent substatements are found by
following the @code{TREE_CHAIN} link from one substatement to the next.
The @code{COMPOUND_BODY} will be @code{NULL_TREE} if there are no
substatements.
@item CONTINUE_STMT
......
2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/20010622-1.c: New test.
2001-06-18 Stan Shebs <shebs@apple.com>
* objc.dg: New directory.
......
/* Test for segfault doing -Wsequence-point processing on an empty
statement expression. */
/* Origin: PR c/3259 from <David.Decotigny@irisa.fr>. */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
void
f (void)
{
({ });
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment