#594 HANDLER-BIND cannot handle handlers defined using CONSTANTLY

closed-fixed
Sam Steingold
clisp (525)
5
2011-03-29
2011-03-29
Sam Steingold
No

(compile nil (lambda (arg)
(handler-bind ((error (constantly nil))) (car arg))))
*** - Compiler bug!! Occurred in ASSEMBLE-LAP at (HANDLER-BEGIN).

this bug was present before the 2005-01-21 patch which made %HANDLER-BIND have a function syntax.
it is now (after the 2011-03-29 patch which fixed bug#3147908) present again.
note that asdf.lisp cannot be compiled ootb until this bug is fixed.

Discussion

  • Sam Steingold
    Sam Steingold
    2011-03-29

    the following seems to work around the bug:
    (defun fix-handler-begin (list)
    "replace (... (HANDLER-BEGIN) ...) with (... (HANDLER-BEGIN&PUSH) (POP) ...)"
    (do ((tail list (cdr tail)))
    ((endp tail) list)
    (when (equal (car tail) '(SYS::HANDLER-BEGIN))
    (setf (car tail) '(SYS::HANDLER-BEGIN&PUSH)
    (cdr tail) (cons '(SYS::POP) (cdr tail))
    tail (cddr tail)))))

    (trace (sys::insert-combined-LAPs :post (fix-handler-begin (car *trace-values*))))

    I wonder if this is the right fix...

     
  • Sam Steingold
    Sam Steingold
    2011-03-29

    thank you for your bug report.
    the bug has been fixed in the source tree (mercurial/hg).
    you can either wait for the next release (recommended)
    or check out the current mercurial tree (see http://clisp.org\)
    and build CLISP from the sources (be advised that between
    releases the source tree is very unstable and may not even build
    on your platform).

     
  • Sam Steingold
    Sam Steingold
    2011-03-29

    • assigned_to: haible --> sds
    • status: open --> closed-fixed