[Git][cmucl/cmucl][issue-97-define-ud2-inst] Address more review comments

Raymond Toy gitlab at common-lisp.net
Wed Apr 21 23:42:16 UTC 2021



Raymond Toy pushed to branch issue-97-define-ud2-inst at cmucl / cmucl


Commits:
cb189a54 by Raymond Toy at 2021-04-21T16:41:54-07:00
Address more review comments

* Replace 63 with 0x3f
* Update comment about checking for UD1.  We don't abort anymore if
  it's not; we just call interrupt_handle_now like we do on other
  ports.

- - - - -


1 changed file:

- src/lisp/x86-arch.c


Changes:

=====================================
src/lisp/x86-arch.c
=====================================
@@ -379,12 +379,9 @@ sigill_handler(HANDLER_ARGS)
             (stderr, "pc %x\n",  *(unsigned short *)SC_PC(context)));
 
     /*
-     * Make sure the trapping instruction is UD1.  Abort if not.
-     *
-     * TODO: aborting is probably not the best idea.  Could get here
-     * from other illegal instructions in, say, C code?  Maybe we
-     * should call interrupt_handle_now, as we do below for an unknown
-     * trap code?
+     * If the trapping instruction is UD1, assume it's a Lisp trap
+     * that we handle here.  Otherwise, just call interrupt_handle_now
+     * for other cases.
      */
     if (memcmp((void *)SC_PC(context), ud1, sizeof(ud1)) == 0) {
       /*
@@ -392,7 +389,7 @@ sigill_handler(HANDLER_ARGS)
        * number is placed in the low 6-bits of the 3rd byte of the
        * instruction.
        */
-      trap = *(((char *)SC_PC(context)) + 2) & 63;
+      trap = *(((char *)SC_PC(context)) + 2) & 0x3f;
 
       DPRINTF(debug_handlers, (stderr, "code = %x\n", trap));
 



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/cb189a54e2903e942da595da411e82c968469cb1

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/cb189a54e2903e942da595da411e82c968469cb1
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20210421/b7cd63b2/attachment.html>


More information about the cmucl-cvs mailing list