* Patch: FYI: PR libgcj/8945
@ 2002-12-18 22:39 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2002-12-18 22:39 UTC (permalink / raw)
To: Java Patch List; +Cc: Gcc Patch List
I'm checking this in on the trunk and the 3.3 branch.
This is a patch from Andrew for PR 8945 (actually the bug that 8945
should be, if it were really a bug report).
Test case included. Built and checked on x86 RHL 7.3.
Tom
Index: gcc/java/ChangeLog
from Andrew Haley <aph@redhat.com>
* parse.y (patch_invoke): Force evaluation order when `check' is
set. For PR libgcj/8945.
Index: gcc/java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.406
diff -u -r1.406 parse.y
--- gcc/java/parse.y 16 Dec 2002 18:22:36 -0000 1.406
+++ gcc/java/parse.y 19 Dec 2002 06:11:02 -0000
@@ -10793,7 +10793,11 @@
is NULL. */
if (check != NULL_TREE)
{
- patch = build (COMPOUND_EXPR, TREE_TYPE (patch), check, patch);
+ /* We have to call force_evaluation_order now because creating a
+ COMPOUND_EXPR wraps the arg list in a way that makes it
+ unrecognizable by force_evaluation_order later. Yuk. */
+ patch = build (COMPOUND_EXPR, TREE_TYPE (patch), check,
+ force_evaluation_order (patch));
TREE_SIDE_EFFECTS (patch) = 1;
}
Index: libjava/testsuite/ChangeLog
from Tom Tromey <tromey@redhat.com>
* libjava.lang/pr8945.java: New file.
* libjava.lang/pr8945.out: New file.
Index: libjava/testsuite/libjava.lang/pr8945.java
===================================================================
RCS file: libjava/testsuite/libjava.lang/pr8945.java
diff -N libjava/testsuite/libjava.lang/pr8945.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libjava/testsuite/libjava.lang/pr8945.java 19 Dec 2002 06:11:05 -0000
@@ -0,0 +1,9 @@
+public class pr8945
+{
+ public static void main(String[] args)
+ {
+ String foo = "hello";
+ int pos = 3;
+ System.out.println(foo.substring(pos,++pos));
+ }
+}
Index: libjava/testsuite/libjava.lang/pr8945.out
===================================================================
RCS file: libjava/testsuite/libjava.lang/pr8945.out
diff -N libjava/testsuite/libjava.lang/pr8945.out
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libjava/testsuite/libjava.lang/pr8945.out 19 Dec 2002 06:11:05 -0000
@@ -0,0 +1 @@
+l
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-12-19 6:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-18 22:39 Patch: FYI: PR libgcj/8945 Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).