[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-kawa] Fwd: compiling swank-kawa.scm gives NullPointerException
From: |
Per Bothner |
Subject: |
Re: [Bug-kawa] Fwd: compiling swank-kawa.scm gives NullPointerException |
Date: |
Wed, 13 Jun 2012 00:18:04 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 06/12/2012 08:56 PM, Tristan Straub wrote:
I'm trying to compile swank-kawa.scm but get the following exception:
$ kawa -C swank-kawa.scm
...
swank-kawa.scm:2122: internal error while compiling swank-kawa.scm
java.lang.NullPointerException
I've reproduced and simplified this to:
(module-export)
(define (list-env (env :: <gnu.mapping.Environment>))
(let ((enum (invoke env 'enumerateAllLocations)))
(let ((pack1 :: <list> '()))
(let ((pack2 (lambda (v) (set! pack1 (cons v pack1)))))
(do () (not (invoke enum 'hasMoreElements))
(pack2 (invoke enum 'nextLocation))))
(reverse! pack1))))
The key appears to be that list-env is unused and not exported,
which seems to be a semi-bug in swank-kawa.scm.
This confuses the compiler: It thinks pack1 is not needed,
because it is never seen during the validate (type-checking)
phase. But then it tries to generate bytecode to access pack1.
I haven't figured out the best fix. If list-env is unused,
then we don't need to generate anything for it.
--
--Per Bothner
address@hidden http://per.bothner.com/