Changeset 14968 for trunk/source/level-1


Ignore:
Timestamp:
Sep 2, 2011, 5:08:51 AM (8 years ago)
Author:
gb
Message:

When an exception occurs and we call out to lisp, if the PC doesn't
seem to be relative to some lisp function -don't- try to pass it
as a fixnum in a single word (that can't work if the PC is high
in the address space, as it certainly can be.) Split it into two
fixnums (in the xcf.relative-pc and xcf.tra slots) instead, and
reassemble it on the lisp side.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/x86-trap-support.lisp

    r14842 r14968  
    342342                        (type (simple-array (unsigned-byte 8) (*)) containing-object))
    343343        (aref containing-object (the fixnum (+ byte-offset delta))))
    344       ;; xcf.relative-pc is a fixnum, but it might be negative.
    345       (let* ((encoded-pc (%get-ptr xcf-ptr target::xcf.relative-pc))
    346              (pc (ash (%ptr-to-int encoded-pc) (- target::fixnumshift))))
     344      ;; xcf.relative-pc is a fixnum containing the high half of the
     345      ;; absolute PC; xcf.ra0 is a fixnum containing the low half
     346      (let* ((high-half byte-offset)
     347             (low-half (%get-object xcf-ptr target::xcf.ra0))
     348             (pc #+64-bit-target (dpb high-half (byte 32 32) low-half)
     349                 #+32-bit-target (dpb high-half (byte 16 16) low-half)))
    347350        (%get-unsigned-byte (%int-to-ptr pc) delta)))))
    348351
Note: See TracChangeset for help on using the changeset viewer.