This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] java/13237
- From: Jeff Sturm <jsturm at one-point dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: java-patches at gcc dot gnu dot org
- Date: Mon, 1 Dec 2003 08:43:23 -0500 (EST)
- Subject: [PATCH] java/13237
patch_method_invocation may convert expr node to a constant due to folding
a builtin method with constant args, e.g. Math.sqrt(2.0). We'd still like
to check exceptions, since a builtin method decl might conceivably have a
throws clause.
Tested on i686-pc-linux-gnu, no regressions anywhere including jacks.
OK for 3.4?
Jeff
2003-11-30 Jeff Sturm <jsturm@one-point.com>
Fix PR java/13237.
* parse.y (java_complete_lhs): Save location prior to patching
CALL_EXPR.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.458
diff -u -p -r1.458 parse.y
--- parse.y 25 Nov 2003 17:32:54 -0000 1.458
+++ parse.y 30 Nov 2003 17:12:15 -0000
@@ -12053,6 +12053,7 @@ java_complete_lhs (tree node)
int from_super = (EXPR_WFL_NODE (TREE_OPERAND (node, 0)) ==
super_identifier_node);
tree arguments;
+ int location = EXPR_WFL_LINECOL (node);
node = patch_method_invocation (node, NULL_TREE, NULL_TREE,
from_super, 0, &decl);
@@ -12064,8 +12065,7 @@ java_complete_lhs (tree node)
arguments = TREE_VALUE (TREE_OPERAND (node, 1));
else
arguments = NULL_TREE;
- check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl,
- arguments);
+ check_thrown_exceptions (location, decl, arguments);
/* If we call this(...), register signature and positions */
if (in_this)
DECL_CONSTRUCTOR_CALLS (current_function_decl) =