From 504be0c7cbf91dce61aa535b2a5805a23d96bb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Mon, 3 Aug 2015 23:45:20 +0200 Subject: [PATCH] VM: signal_error and fp_trap_error not needed, call general_error directly --- vm/errors.cpp | 14 ++------------ vm/vm.hpp | 2 -- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/vm/errors.cpp b/vm/errors.cpp index c34fe630d8..6586bd4e0b 100644 --- a/vm/errors.cpp +++ b/vm/errors.cpp @@ -133,21 +133,11 @@ void factor_vm::memory_protection_error(cell pc, cell addr) { general_error(ERROR_MEMORY, from_unsigned_cell(addr), false_object); } -/* Allocates memory */ -void factor_vm::signal_error(cell signal) { - general_error(ERROR_SIGNAL, from_unsigned_cell(signal), false_object); -} - /* Allocates memory */ void factor_vm::divide_by_zero_error() { general_error(ERROR_DIVIDE_BY_ZERO, false_object, false_object); } -/* Allocates memory */ -void factor_vm::fp_trap_error(unsigned int fpu_status) { - general_error(ERROR_FP_TRAP, tag_fixnum(fpu_status), false_object); -} - /* For testing purposes */ /* Allocates memory */ void factor_vm::primitive_unimplemented() { not_implemented_error(); } @@ -169,7 +159,7 @@ void memory_signal_handler_impl() { /* Allocates memory */ void factor_vm::synchronous_signal_handler_impl() { - signal_error(signal_number); + general_error(ERROR_SIGNAL, from_unsigned_cell(signal_number), false_object); } /* Allocates memory */ @@ -182,7 +172,7 @@ void factor_vm::fp_signal_handler_impl() { /* Clear pending exceptions to avoid getting stuck in a loop */ set_fpu_state(get_fpu_state()); - fp_trap_error(signal_fpu_status); + general_error(ERROR_FP_TRAP, tag_fixnum(signal_fpu_status), false_object); } /* Allocates memory */ diff --git a/vm/vm.hpp b/vm/vm.hpp index c37638a7fc..ac9153fb29 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -218,9 +218,7 @@ struct factor_vm { void not_implemented_error(); void verify_memory_protection_error(cell addr); void memory_protection_error(cell pc, cell addr); - void signal_error(cell signal); void divide_by_zero_error(); - void fp_trap_error(unsigned int fpu_status); void primitive_unimplemented(); void memory_signal_handler_impl(); void synchronous_signal_handler_impl();