diff --git a/core/math/math-docs.factor b/core/math/math-docs.factor index d98685fb48..97e0a1e7cf 100644 --- a/core/math/math-docs.factor +++ b/core/math/math-docs.factor @@ -282,12 +282,12 @@ HELP: fp-bitwise= { $examples "Not-a-number equality:" { $example - "USING: math prettyprint ;" + "USING: kernel math prettyprint ;" "0.0 0.0 / dup number= ." "f" } { $example - "USING: math prettyprint ;" + "USING: kernel math prettyprint ;" "0.0 0.0 / dup fp-bitwise= ." "t" } @@ -299,7 +299,7 @@ HELP: fp-bitwise= } { $example "USING: math prettyprint ;" - "-0.0 0.0 = ." + "-0.0 0.0 number= ." "t" } } ; diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index 19e644cb68..0a11f62c16 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -612,8 +612,8 @@ HELP: NAN: { $examples { $example "USE: prettyprint" - "NAN: deadbeef ." - "NAN: deadbeef" + "NAN: 80000deadbeef ." + "NAN: 80000deadbeef" } } ; diff --git a/vm/errors.cpp b/vm/errors.cpp index 1dcee889a3..c9d2a94e56 100644 --- a/vm/errors.cpp +++ b/vm/errors.cpp @@ -130,9 +130,9 @@ void divide_by_zero_error() general_error(ERROR_DIVIDE_BY_ZERO,F,F,NULL); } -void fp_trap_error() +void fp_trap_error(stack_frame *signal_callstack_top) { - general_error(ERROR_FP_TRAP,F,F,NULL); + general_error(ERROR_FP_TRAP,F,F,signal_callstack_top); } PRIMITIVE(call_clear) @@ -158,7 +158,7 @@ void misc_signal_handler_impl() void fp_signal_handler_impl() { - fp_trap_error(); + fp_trap_error(signal_callstack_top); } } diff --git a/vm/mach_signal.cpp b/vm/mach_signal.cpp index 50a924f8e4..facf512b77 100644 --- a/vm/mach_signal.cpp +++ b/vm/mach_signal.cpp @@ -55,12 +55,12 @@ static void call_fault_handler( MACH_PROGRAM_COUNTER(thread_state) = (cell)memory_signal_handler_impl; } else if(exception == EXC_ARITHMETIC && code != MACH_EXC_INTEGER_DIV) - { + { MACH_PROGRAM_COUNTER(thread_state) = (cell)fp_signal_handler_impl; - } - else - { - signal_number = exception == EXC_ARITHMETIC ? SIGFPE : SIGABRT; + } + else + { + signal_number = (exception == EXC_ARITHMETIC ? SIGFPE : SIGABRT); MACH_PROGRAM_COUNTER(thread_state) = (cell)misc_signal_handler_impl; } }