This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: NullPointerException in emitLoad
- From: Per Bothner <per at bothner dot com>
- To: Chris Dean <Chris dot Dean at sokitomi dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Wed, 19 Mar 2003 23:43:13 -0800
- Subject: Re: NullPointerException in emitLoad
- References: <18658.1048111851@mercedsystems.com>
Chris Dean wrote:
I get a NullPointerException when compiling this code:
(module-static #f)
(define (my-factorial n)
(if (<= n 1)
1
(* n (my-factorial (- n 1)))))
This is probably caused by the 2003-03-02 change
to LambdaExp.java. Unfortunately, I don't quite
remember why I made this change, so I'm not sure
yet if the attached patch is correct.
--
--Per Bothner
per at bothner dot com http://per.bothner.com/
Index: ApplyExp.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/ApplyExp.java,v
retrieving revision 1.56
diff -u -r1.56 ApplyExp.java
--- ApplyExp.java 25 Jan 2003 07:49:17 -0000 1.56
+++ ApplyExp.java 20 Mar 2003 07:37:36 -0000
@@ -188,7 +188,7 @@
if (is_static)
extraArg = 1;
if (comp.curLambda == func_lambda)
- code.emitLoad(func_lambda.closureEnv); // Recursive call.
+ code.emitLoad(func_lambda.closureEnv != null ? func_lambda.closureEnv : func_lambda.thisVariable); // Recursive call.
else
LambdaExp.getHeapLambda(func_lambda.outerLambda()).loadHeapFrame(comp);
}