This is the mail archive of the kawa@sources.redhat.com 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: NullPointerException in emitLoad


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);
 	      }

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