This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Kawa 1.13 compilation problem, possible regression


On 05/04/2013 08:32 PM, Matthieu Vachon wrote:
Hi Per,

I tried to compile latest version (r7491) but was not able to do so
under java5. With java6, it went well and didn't hit any problems.
Here the failing bit when compiling with java5:

[kawac] (compiling c:\Nu\kawa\kawa\lib\rnrs\unicode.scm to
kawa.lib.rnrs.unicode)
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: unreachable procedure call
[kawac] c:\Nu\kawa\kawa\lib\rnrs\unicode.scm:117:11: note - this
operand never finishes

I checked the code in `unicode.scm` but could find something wrong
from my point of view.

The reason is that on java5 the cond-expand tag
string-normalize-unicode is false, so we get the equivalent of:

(define (string-normalize-nfd (str :: string)) :: string
  (error "unicode string normalization not available"))

The complaint is that the never-returns value of is incompatible
with the return value of string.  Which is true - but we should
allow it anyway.  And that was the intention, but there was
a little bug - incorrect variable reuse.  Should be fixed
in the attached patch.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/
Index: gnu/expr/ChainLambdas.java
===================================================================
--- gnu/expr/ChainLambdas.java	(revision 7491)
+++ gnu/expr/ChainLambdas.java	(working copy)
@@ -50,21 +50,21 @@
     }
 
     protected Expression visitApplyExp(ApplyExp exp, ScopeExp scope) {
-        Expression e = visit(exp.func, scope);
+        Expression f = visit(exp.func, scope);
         Expression[] args = exp.args;
         int nargs = args.length;
-        exp.func = e;
-        if (e.neverReturns()) {
+        exp.func = f;
+        if (f.neverReturns()) {
             maybeWarnUnreachable(nargs > 0 ? args[0] : exp);
-            return e;
+            return f;
         }
         for (int i = 0; i < nargs;  i++) {
-            e = visit(args[i], scope);
+            Expression e = visit(args[i], scope);
             if (e.neverReturns()
                 // It seems best to silently allow converting never-returns
                 // to any type.  For example it useful for stub procedures
                 // that throw an "unimplemented" exception.
-                && ! (e.valueIfConstant() instanceof Convert)) {
+                && ! (f.valueIfConstant() instanceof Convert)) {
                 Expression[] xargs = new Expression[i+2];
                 xargs[0] = exp.func;
                 System.arraycopy(args, 0, xargs, 1, i+1);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]