Comment 1 for bug 396974

Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: unbound slot in division-by-zero

The bug resides in src/code/float-traps.lisp:

(defun sigfpe-handler (signal info context)
  (declare (ignore signal context))
  (declare (type system-area-pointer info))
  (let ((code (sb!unix::siginfo-code info)))
    (with-interrupts
        (error (or (cdr (assoc code *sigfpe-code-error-alist*))
                   'floating-point-exception)))))

We signal the error without providing either :operation or :operands.

Since all conditions signalled are subclasses or ARITHMETIC-ERROR, that's a bit suboptimal.

Getting access to operation for DIVISION-BY-ZERO is a no-brainer (we can always call it /), for the others it requires parsing the offending instruction -- ditto for operands.

Perhaps defaulting both to NIL is an acceptable least-evil for now?