diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 2000-12-15 08:50:12 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2000-12-15 00:50:12 -0800 |
commit | 1e0cdc10363525fb7688ab6fc8654a5c15248795 (patch) | |
tree | 39d9e5c56f4b850fb374a53d85cf034a883f62e9 /gcc/java | |
parent | 40244a275776ada7f5839d25296c5f991bd7ab0b (diff) | |
download | gcc-1e0cdc10363525fb7688ab6fc8654a5c15248795.zip gcc-1e0cdc10363525fb7688ab6fc8654a5c15248795.tar.gz gcc-1e0cdc10363525fb7688ab6fc8654a5c15248795.tar.bz2 |
parse.y (end_artificial_method_body): Fixed undefined behavior.
2000-12-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (end_artificial_method_body): Fixed undefined behavior.
Credits go to rth for finding it.
(http://gcc.gnu.org/ml/gcc/2000-12/msg00495.html)
From-SVN: r38278
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/parse.y | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4385b49..70065a9 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2000-12-15 Alexandre Petit-Bianco <apbianco@cygnus.com> + + * parse.y (end_artificial_method_body): Fixed undefined behavior. + Credits go to rth for finding it. + 2000-12-13 Mike Stump <mrs@wrs.com> * parse.y (check_static_final_variable_assignment_flag): Fix spelling. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 00a5544..7a23e72 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -7200,7 +7200,11 @@ static void end_artificial_method_body (mdecl) tree mdecl; { - BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (mdecl)) = exit_block (); + /* exit_block modifies DECL_FUNCTION_BODY (current_function_decl). + It has to be evaluated first. (if mdecl is current_function_decl, + we have an undefined behavior if no temporary variable is used.) */ + tree b = exit_block (); + BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (mdecl)) = b; exit_block (); } |