]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/errors.cpp
webapps.wiki: adding search bar
[factor.git] / vm / errors.cpp
index 909efce7770acd3ae33866e24a9898c893a2328a..74ba10056c095bb1476e0e5aeaa37de025f8ff1d 100644 (file)
@@ -93,22 +93,19 @@ void factor_vm::type_error(cell type, cell tagged) {
   general_error(ERROR_TYPE, tag_fixnum(type), tagged);
 }
 
-// Allocates memory
-void factor_vm::not_implemented_error() {
-  general_error(ERROR_NOT_IMPLEMENTED, false_object, false_object);
-}
-
-void factor_vm::verify_memory_protection_error(cell addr) {
+void factor_vm::set_memory_protection_error(cell fault_addr, cell fault_pc) {
   // Called from the OS-specific top halves of the signal handlers to
   // make sure it's safe to dispatch to memory_signal_handler_impl.
   if (fatal_erroring_p)
     fa_diddly_atal_error();
-  if (faulting_p && !code->safepoint_p(addr))
-    fatal_error("Double fault", addr);
+  if (faulting_p && !code->safepoint_p(fault_addr))
+    fatal_error("Double fault", fault_addr);
   else if (fep_p)
-    fatal_error("Memory protection fault during low-level debugger", addr);
+    fatal_error("Memory protection fault during low-level debugger", fault_addr);
   else if (atomic::load(&current_gc_p))
-    fatal_error("Memory protection fault during gc", addr);
+    fatal_error("Memory protection fault during gc", fault_addr);
+  signal_fault_addr = fault_addr;
+  signal_fault_pc = fault_pc;
 }
 
 // Allocates memory
@@ -116,10 +113,6 @@ void factor_vm::divide_by_zero_error() {
   general_error(ERROR_DIVIDE_BY_ZERO, false_object, false_object);
 }
 
-// For testing purposes
-// Allocates memory
-void factor_vm::primitive_unimplemented() { not_implemented_error(); }
-
 // Allocates memory
 void memory_signal_handler_impl() {
   factor_vm* vm = current_vm();