Bug in kjc

Edouard G. Parmelan Edouard.Parmelan at quadratec.fr
Fri Feb 11 02:38:49 PST 2000


Patrick Tullmann wrote:

> I sent this in to the KOPI folks, but I haven't heard a peep from
> them.
They work on GNU Kopi 1.5.  Yes, it's now part of GNU Project !

> As an FYI to other Kaffer's, I present the do-while bug in kjc.

> I haven't tried upgrading to the latest KJC.

kjc-1.4C have the same bug :(

It's trivial patch in kjc/JDoStatement.java (attached).  I also attach
compiled class at/dms/kjc/JDoStatement.class for kjc-1.4B (version used
Kaffe CVS tree), let me now if you use another version of kjc.
-- 
Edouard G. Parmelan
http://egp.free.fr
-------------- next part --------------
--- kjc/JDoStatement.java.orig	Mon Dec 13 14:11:58 1999
+++ kjc/JDoStatement.java	Fri Feb 11 11:24:28 2000
@@ -110,12 +110,14 @@
    */
   public void genCode(CodeSequence code) {
     code.setLineNumber(getTokenReference().getLine());
+    CodeLabel begin = new CodeLabel();
 
     code.pushContext(this);
 
-    code.plantLabel(getContinue());			//	cont:
+    code.plantLabel(begin);			//	begin:
     body.genCode(code);				//		BODY CODE
-    cond.genBranch(true, code, getContinue());	//		EXPR
+    code.plantLabel(getContinue());		//	cont:
+    cond.genBranch(true, code, begin);		//		EXPR
     code.plantLabel(getEnd());			//	end:	...
 
     code.popContext(this);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JDoStatement.class
Type: application/octet-stream
Size: 3345 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20000211/29c69511/attachment-0003.obj 


More information about the kaffe mailing list