This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: java instance initializers
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: PATCH: java instance initializers
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Tue, 3 Jul 2001 08:57:37 -0700 (PDT)
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10107030224030.18500-100000@mars.deadcafe.org>
- Reply-To: apbianco at cygnus dot com
Jeff Sturm writes:
> If a java class contains instance initializers called through a
> constructor invoking `this', the initializers are executed twice:
Good catch. Thanks.
> The patch below fixes this bug and passes the libgcj testsuite. OK
> for trunk?
Yes.
> @@ -8544,6 +8545,9 @@
> {
> case CALL_EXPR:
> found = CALL_EXPLICIT_CONSTRUCTOR_P (body);
> + if (EXPR_WFL_NODE (TREE_OPERAND (body, 0)) ==
> + this_identifier_node)
> + invokes_this = 1;
> body = NULL_TREE;
> break;
> case COMPOUND_EXPR:
I would just say:
> {
> case CALL_EXPR:
> found = CALL_EXPLICIT_CONSTRUCTOR_P (body);
> + invokes_this = CALL_THIS_CONSTRUCTOR_P (body)
> body = NULL_TREE;
> break;
> case COMPOUND_EXPR:
./A