10 Dec 2005 16:58
Problem in INTEGRATE-JUMP-PROCS!
Heath Putnam <hp <at> heathputnam.com>
2005-12-10 15:58:12 GMT
2005-12-10 15:58:12 GMT
The following is a procedure that the prescheme compiler fails on. I'm
not what it should do when given such a procedure --
e.g. automatically "lambda lift" FAIL's LEN parameter, give an error
saying that FAIL can't be turned into a jump, etc.
I do think the error that appears is quite cryptic:
"Error: variable #{Variable len 326} has no vector location
(compiler error)
(&error)"
As far as I can tell, the problem happens when PROCS->JUMPS tries to
turn LOOP and FAIL into jumps. It winds up moving FAIL above the
binding for LEN, which is an error. Changing FAIL (and applications of
FAIL) so that len is not free fixes things.
Here's the procedure, derived from my real program, and as simplified
as I can get it:
;; This is about as small as it gets, and still breaking things.
(define (bad-proc)
(let loop ()
;; try to get a new result buffer if it is missing
(let ((len ((external "dummy" (=> () integer)))))
(let ((fail (lambda ()
((external "output" (=> (integer) unit)) len))))
(if ((external "b" (=> () boolean)))
(if (= 2 (unsigned-byte-ref (address+ (address+ null-address 2) 1)))
(loop)
(Continue reading)
RSS Feed