This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Problem with primitive-throw?
- From: Per Bothner <per at bothner dot com>
- To: dominique dot boucher at nuecho dot com
- Cc: "'Kawa List'" <kawa at sources dot redhat dot com>
- Date: Fri, 20 Feb 2004 11:07:59 -0800
- Subject: Re: Problem with primitive-throw?
- References: <000701c3f7c1$a230c5c0$6400a8c0@Forman>
Dominique Boucher wrote:
java.lang.Error: popType called with empty stack
test.apply(gnu.mapping.CallContext)void
at gnu.bytecode.CodeAttr.popType(CodeAttr.java:207)
at gnu.bytecode.CodeAttr.emitStore(CodeAttr.java:1072)
at gnu.bytecode.CodeAttr.emitTryEnd(CodeAttr.java:1876)
I checked in the attached patch.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
Index: CodeAttr.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/bytecode/CodeAttr.java,v
retrieving revision 1.66
diff -u -r1.66 CodeAttr.java
--- CodeAttr.java 3 Feb 2004 19:41:47 -0000 1.66
+++ CodeAttr.java 20 Feb 2004 19:05:01 -0000
@@ -1,4 +1,4 @@
-// Copyright (c) 1997, 1998, 1999, 2001, 2003 Per M.A. Bothner.
+// Copyright (c) 1997, 1998, 1999, 2001, 2003, 2004 Per M.A. Bothner.
// This is free software; for terms and warranty disclaimer see ./COPYING.
package gnu.bytecode;
@@ -1872,7 +1872,7 @@
{
if (try_stack.end_label == null)
{
- if (try_stack.saved_result != null)
+ if (try_stack.saved_result != null && reachableHere())
emitStore(try_stack.saved_result);
try_stack.end_label = new Label(this);
if (reachableHere())