]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/mach_signal.cpp
tools.scaffold: don't use sequences.extras.
[factor.git] / vm / mach_signal.cpp
index 6994b4b4ef1cf4fc4a0112f0862f378a33730f1a..f8f8165a58cea37e59460bf293ebf0296afbaa3f 100644 (file)
@@ -36,9 +36,8 @@ void factor_vm::call_fault_handler(exception_type_t exception,
   cell handler = 0;
 
   if (exception == EXC_BAD_ACCESS) {
-    signal_fault_addr = MACH_EXC_STATE_FAULT(exc_state);
-    signal_fault_pc = (cell)MACH_PROGRAM_COUNTER(thread_state);
-    verify_memory_protection_error(signal_fault_addr);
+    set_memory_protection_error(MACH_EXC_STATE_FAULT(exc_state),
+                                (cell)MACH_PROGRAM_COUNTER(thread_state));
     handler = (cell)factor::memory_signal_handler_impl;
   } else if (exception == EXC_ARITHMETIC && code != MACH_EXC_INTEGER_DIV) {
     signal_fpu_status = fpu_status(mach_fpu_status(float_state));
@@ -90,6 +89,8 @@ extern "C" kern_return_t catch_exception_raise(
     mach_port_t exception_port, mach_port_t thread, mach_port_t task,
     exception_type_t exception, exception_data_t code,
     mach_msg_type_number_t code_count) {
+  (void) exception_port;
+  (void) code_count;
   // 10.6 likes to report exceptions from child processes too. Ignore those
   if (task != mach_task_self())
     return KERN_FAILURE;
@@ -150,6 +151,7 @@ extern "C" kern_return_t catch_exception_raise(
 
 // The main function of the thread listening for exceptions.
 static void* mach_exception_thread(void* arg) {
+  (void) arg;
   for (;;) {
     // These two structures contain some private kernel data. We don't need
     // to access any of it so we don't bother defining a proper struct. The
@@ -166,13 +168,10 @@ static void* mach_exception_thread(void* arg) {
       char data[1024];
     } reply;
 
-    mach_msg_return_t retval;
-
     // Wait for a message on the exception port.
-    retval =
-        mach_msg(&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof(msg),
-                 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
-    if (retval != MACH_MSG_SUCCESS) {
+    if (mach_msg(&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof(msg),
+                 our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL) !=
+        MACH_MSG_SUCCESS) {
       abort();
     }