Patch: RFA: fix PR java/17329
Andrew Haley
aph@redhat.com
Thu Sep 23 23:44:00 GMT 2004
Tom Tromey writes:
> In PR 17329, we are compiling code like this, where Options is a
> different class:
>
> Options.verbose += 2;
>
> This results in a save_expr the _Jv_InitClass call; there is special
> code in gimplify_save_expr() to handle this (searching for "java" in
> this file was enlightening, I had no idea about all these special
> cases).
>
> Anyway, gimplify_save_expr will set the save_expr argument to NULL the
> first time it is seen, but java_gimplify_expr doesn't account for this
> case and crashes.
>
>
> Index: gcc/java/ChangeLog
> from Tom Tromey <tromey@redhat.com>
> PR java/17329:
> * java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
> where operand is null.
This is fine.
I guess this happens when we generate a SAVE_EXPR with void type. I
wanted to be able to say "is this a variable?" for which
(TREE_CODE (TREE_OPERAND (*expr_p, 0)) == VAR_DECL)
looked fine. But I'd either forgotten, or never knew, that we
{ab}used SAVE_EXPRs with void type.
Andrew.
More information about the Java-patches
mailing list