This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 13026 fix
- From: Tom Tromey <tromey at redhat dot com>
- To: GCC libjava patches <java-patches at gcc dot gnu dot org>
- Date: 18 Nov 2003 19:59:38 -0700
- Subject: Patch: FYI: PR 13026 fix
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk.
This fixes PR 13026. The problem was that state::copy incorrectly
handled "ret semantics". Instead of copying a local variable that
was modified in a subroutine, instead it set it to unsuitable_type.
Tested against the mauve verifier test suite with no regressions.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR libgcj/13026:
* verify.cc (state::copy): Only set local_changed if we're in a
subroutine. Correctly copy local variables which were modified
by the subroutine.
(push_jump_merge): Added more debugging output.
Index: verify.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.56
diff -u -r1.56 verify.cc
--- verify.cc 24 Jul 2003 17:18:00 -0000 1.56
+++ verify.cc 19 Nov 2003 03:07:12 -0000
@@ -1025,11 +1025,11 @@
// See push_jump_merge to understand this case.
if (ret_semantics)
locals[i] = type (copy->local_changed[i]
- ? unsuitable_type
+ ? copy->locals[i]
: unused_by_subroutine_type);
else
locals[i] = copy->locals[i];
- local_changed[i] = copy->local_changed[i];
+ local_changed[i] = subroutine ? copy->local_changed[i] : false;
}
clean_subrs ();
@@ -1465,7 +1465,8 @@
// which was not modified by the subroutine.
states[npc] = new state (nstate, current_method->max_stack,
current_method->max_locals, ret_semantics);
- debug_print ("== New state in push_jump_merge\n");
+ debug_print ("== New state in push_jump_merge (ret_semantics = %s)\n",
+ ret_semantics ? "true" : "false");
states[npc]->print ("New", npc, current_method->max_stack,
current_method->max_locals);
}