This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
bug in compiling not
- To: kawa at sources dot redhat dot com
- Subject: bug in compiling not
- From: Felix S Klock II <pnkfelix at MIT dot EDU>
- Date: Mon, 13 Aug 2001 03:55:01 -0400
Kawa list-
There is a bug in Kawa's compilation of the 'not' procedure; it only
shows up during compilation of a scheme program, not during
interpretation of it.
I've included a workaround that disables the offending code segment; I
don't understand enough about the design of the system to provide a
better fix.
-Felix
-- test file: "kawa-is-broken.scm" --
(define (break)
(let ((f #f))
(not f)))
-- command line to compile file --
% java -jar kawa-1.6.95.jar -C kawa-is-broken.scm
-- stack trace due to exception throw by compiler --
java.lang.Error: non-matching or bad types in binary operation
at java.lang.Throwable.<init>(Throwable.java:96)
at java.lang.Error.<init>(Error.java:52)
at gnu.bytecode.CodeAttr.emitBinop(CodeAttr.java:772)
at gnu.bytecode.CodeAttr.emitAdd(CodeAttr.java:801)
at gnu.bytecode.CodeAttr.emitNot(CodeAttr.java:821)
at kawa.standard.not.compile(not.java:50)
at gnu.expr.ApplyExp.compile(ApplyExp.java:158)
at gnu.expr.ApplyExp.compile(ApplyExp.java:115)
at gnu.expr.Expression.compileNotePosition(Expression.java:60)
at gnu.expr.Expression.compileWithPosition(Expression.java:47)
at gnu.expr.LetExp.compile(LetExp.java:73)
at gnu.expr.Expression.compileNotePosition(Expression.java:60)
at gnu.expr.Expression.compileWithPosition(Expression.java:47)
at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1411)
at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1383)
at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:577)
at gnu.expr.SetExp.compile(SetExp.java:142)
at gnu.expr.Expression.compileNotePosition(Expression.java:60)
at gnu.expr.Expression.compileWithPosition(Expression.java:47)
at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1411)
at gnu.expr.Compilation.addClass(Compilation.java:1154)
at gnu.expr.Compilation.<init>(Compilation.java:633)
at gnu.expr.ModuleExp.compileToFiles(ModuleExp.java:272)
at kawa.lang.CompileFile.compile_to_files(CompileFile.java:104)
at kawa.repl.main(repl.java:191)
-- cvs diff -u against workaround (hack, not desired solution) --
Index: kawa/standard/not.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/standard/not.java,v
retrieving revision 1.12
diff -u -r1.12 not.java
--- not.java 2000/10/12 18:43:56 1.12
+++ not.java 2001/08/13 07:52:13
@@ -44,7 +44,7 @@
}
CodeAttr code = comp.getCode();
Type type = target.getType();
- if (target instanceof StackTarget && type.getSignature().charAt(0) == 'Z')
+ if (false && target instanceof StackTarget && type.getSignature().charAt(0) == 'Z')
{
arg.compile(comp, target);
code.emitNot(target.getType());