[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiler bug



The following compiler bug appears to be hard to fix, so I will content
myself with just reporting it.

Nothing anywhere in the compiler makes any attempt to unbind special
variables bound by contours unwound through by RETURN-FROM.  The
following is about the simplest case that exhibits this lossage:
	(SPECIAL FOOSP)
	(DEFUN FOO1 (X)
	    (DO () (NIL)
	      (LET ((FOOSP X))
		(RETURN)))
	    (CONS FOOSP X))

The (RETURN) turns into (RETURN-FROM-T (RETURN)) because the LET turns into
an SPROG.  In general, any GO or RETURN that passes "through" any special
bindings does not unbind them.  The only things I can find that do unbind
special bindings are function-exit and *THROW (in the microcode), and
falling off the end of a contour (and simple RETURN which turns into the
same thing.)

Needless to say it would be a good idea to fix this since it isn't hard for
it to introduce a subtle bug into someone's code (the example was rendered
down from a much more complicated function involving multiple bindings and
unwind-protects which didn't quite work.)