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
1 changed file:
Changes:
... | ... | @@ -379,12 +379,9 @@ sigill_handler(HANDLER_ARGS) |
379 | 379 |
(stderr, "pc %x\n", *(unsigned short *)SC_PC(context)));
|
380 | 380 |
|
381 | 381 |
/*
|
382 |
- * Make sure the trapping instruction is UD1. Abort if not.
|
|
383 |
- *
|
|
384 |
- * TODO: aborting is probably not the best idea. Could get here
|
|
385 |
- * from other illegal instructions in, say, C code? Maybe we
|
|
386 |
- * should call interrupt_handle_now, as we do below for an unknown
|
|
387 |
- * trap code?
|
|
382 |
+ * If the trapping instruction is UD1, assume it's a Lisp trap
|
|
383 |
+ * that we handle here. Otherwise, just call interrupt_handle_now
|
|
384 |
+ * for other cases.
|
|
388 | 385 |
*/
|
389 | 386 |
if (memcmp((void *)SC_PC(context), ud1, sizeof(ud1)) == 0) {
|
390 | 387 |
/*
|
... | ... | @@ -392,7 +389,7 @@ sigill_handler(HANDLER_ARGS) |
392 | 389 |
* number is placed in the low 6-bits of the 3rd byte of the
|
393 | 390 |
* instruction.
|
394 | 391 |
*/
|
395 |
- trap = *(((char *)SC_PC(context)) + 2) & 63;
|
|
392 |
+ trap = *(((char *)SC_PC(context)) + 2) & 0x3f;
|
|
396 | 393 |
|
397 | 394 |
DPRINTF(debug_handlers, (stderr, "code = %x\n", trap));
|
398 | 395 |
|