This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Error messages during load of .scm file
Sven Hartrumpf wrote:
O.K. I have isolated the following reduced function "make-mf" (which makes
not much sense any more, but shows the error when loaded into Kawa, although
other Schemes can load it):
The attached patch appears to fix the problem. It's actually
a simplification and optimization, and I'm a little nervous about
such a change just before the 1.7 release.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
Index: LambdaExp.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/LambdaExp.java,v
retrieving revision 1.75
diff -u -r1.75 LambdaExp.java
--- LambdaExp.java 20 Apr 2003 01:52:06 -0000 1.75
+++ LambdaExp.java 30 May 2003 18:11:04 -0000
@@ -359,7 +359,9 @@
else if (parent.heapFrame == null && ! parent.getNeedsStaticLink()
&& ! (parent instanceof ModuleExp))
closureEnv = null;
- else if (! isClassGenerated() && ! getInlineOnly())
+ else if (getInlineOnly())
+ closureEnv = parentFrame;
+ else if (! isClassGenerated())
{
Method primMethod = getMainMethod();
if (! primMethod.getStaticFlag())
@@ -375,18 +377,9 @@
}
else
{
- LambdaExp caller = getInlineOnly() ? getCaller() : null;
- if (parent == caller)
- closureEnv = parentFrame;
- else if (caller != null && parent == caller.outerLambdaNotInline())
- closureEnv = caller.closureEnv;
- else
- {
- closureEnv = new Variable("closureEnv",
- parentFrame.getType());
- scope.addVariable(closureEnv);
- closureEnv.setArtificial(true);
- }
+ closureEnv = new Variable("closureEnv", parentFrame.getType());
+ scope.addVariable(closureEnv);
+ closureEnv.setArtificial(true);
}
}
return closureEnv;
@@ -1010,18 +1003,13 @@
scope.setStartPC(code.getPC());
if (closureEnv != null && ! closureEnv.isParameter()
- && ! comp.usingCPStyle())
+ && ! comp.usingCPStyle() && ! getInlineOnly())
{
- if (getInlineOnly())
- outerLambda().loadHeapFrame(comp);
- else
- {
- code.emitPushThis();
- Field field = closureEnvField;
- if (field == null)
- field = outerLambda().closureEnvField;
- code.emitGetField(field);
- }
+ code.emitPushThis();
+ Field field = closureEnvField;
+ if (field == null)
+ field = outerLambda().closureEnvField;
+ code.emitGetField(field);
code.emitStore(closureEnv);
}
if (! comp.usingCPStyle())