Changeset 14968


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.

Location:
trunk/source
Files:
2 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
  • trunk/source/lisp-kernel/x86-exceptions.c

    r14876 r14968  
    474474  } else {
    475475    containing_uvector = lisp_nil;
    476     relative_pc = abs_pc << fixnumshift;
     476#if WORD_SIZE == 64
     477    relative_pc = ((abs_pc >> 32) & 0xffffffff) << fixnumshift;
     478    tra = (abs_pc & 0xffffffff) << fixnumshift;
     479#else
     480    relative_pc = ((abs_pc >> 16) & 0xffff) << fixnumshift;
     481    tra = (abs_pc & 0xffff) << fixnumshift;
     482#endif
    477483  }
    478484  push_on_lisp_stack(xp,(LispObj)(tcr->xframe->prev));
Note: See TracChangeset for help on using the changeset viewer.