Changeset 8798


Ignore:
Timestamp:
Mar 17, 2008, 6:58:57 AM (11 years ago)
Author:
gb
Message:

Needs more work for win64; for now, at least use a hack to conditionalize
names of arithmetic error codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/level-1/x86-trap-support.lisp

    r8130 r8798  
    191191  (values 'unknown nil))
    192192
     193(eval-when (:compile-toplevel :execute)
     194  (progn
     195    (defun conditional-os-constant (alternatives)
     196      (dolist (c alternatives (error "None of the constants in ~s could be loaded" alternatives))
     197        (if (load-os-constant c t)
     198          (return (load-os-constant c)))))
     199
     200    (defconstant integer-divide-by-zero-code
     201      (conditional-os-constant '(os::EXCEPTION_INT_DIVIDE_BY_ZERO os::FPE_INTDIV))
     202)
     203    (defconstant float-divide-by-zero-code
     204      (conditional-os-constant '(os::EXCEPTION_FLT_DIVIDE_BY_ZERO os::FPE_FLTDIV)))
     205    (defconstant float-overflow-code
     206      (conditional-os-constant '(os::FPE_FLTOVF os::EXCEPTION_FLT_OVERFLOW)))
     207    (defconstant float-underflow-code
     208      (conditional-os-constant '(os::FPE_FLTUND os::EXCEPTION_FLT_UNDERFLOW)))
     209    (defconstant float-inexact-code
     210      (conditional-os-constant '(os::FPE_FLTRES os::EXCEPTION_FLT_INEXACT_RESULT)))))
     211   
    193212;;; UUOs are handled elsewhere.  This should handle all signals other than
    194213;;; those generated by UUOs (and the non-UUO cases of things like SIGSEGV.)
     
    205224               (decode-arithmetic-error xp xcf)
    206225             (let* ((condition-name
    207                      (cond ((or (= code #$FPE_INTDIV)
    208                                 (= code #$FPE_FLTDIV))
     226                     (cond ((or (= code integer-divide-by-zero-code)
     227                                (= code float-divide-by-zero-code))
    209228                            'division-by-zero)
    210                            ((= code #$FPE_FLTOVF)
     229                           ((= code float-overflow-code)
    211230                            'floating-point-overflow)
    212                            ((= code #$FPE_FLTUND)
     231                           ((= code float-underflow-code)
    213232                            'floating-point-underflow)
    214                            ((= code #$FPE_FLTRES)
     233                           ((= code float-inexact-code)
    215234                            'floating-point-inexact)
    216235                           (t
Note: See TracChangeset for help on using the changeset viewer.