ruby-changes:58177
From: Yusuke <ko1@a...>
Date: Wed, 9 Oct 2019 23:23:02 +0900 (JST)
Subject: [ruby-changes:58177] dd477df411 (master): error.c (rb_bug_for_fatal_signal): renamed from rb_bug_context
https://git.ruby-lang.org/ruby.git/commit/?id=dd477df411 From dd477df411691803fc5a83c7daa64faac112a0e4 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Wed, 9 Oct 2019 23:02:22 +0900 Subject: error.c (rb_bug_for_fatal_signal): renamed from rb_bug_context Just refactoring. The name "rb_bug_context" is completely unclear for me. (Can you see that "context" means "machine register context"?) The context is available only when a fatal signal (sigbus, sigsegv, or sigill) is received; in fact, the function is used only for fatal signals. So, I think the name should be changed. diff --git a/error.c b/error.c index bef5090..56ea9ae 100644 --- a/error.c +++ b/error.c @@ -599,7 +599,7 @@ rb_bug(const char *fmt, ...) https://github.com/ruby/ruby/blob/trunk/error.c#L599 } void -rb_bug_context(const void *ctx, const char *fmt, ...) +rb_bug_for_fatal_signal(const void *ctx, const char *fmt, ...) { const char *file = NULL; int line = 0; diff --git a/signal.c b/signal.c index 7fc93bb..638a0d1 100644 --- a/signal.c +++ b/signal.c @@ -933,7 +933,7 @@ sigbus(int sig SIGINFO_ARG) https://github.com/ruby/ruby/blob/trunk/signal.c#L933 #if defined __APPLE__ || defined __linux__ CHECK_STACK_OVERFLOW(); #endif - rb_bug_context(SIGINFO_CTX, "Bus Error" MESSAGE_FAULT_ADDRESS); + rb_bug_for_fatal_signal(SIGINFO_CTX, "Bus Error" MESSAGE_FAULT_ADDRESS); } #endif @@ -946,7 +946,7 @@ sigsegv(int sig SIGINFO_ARG) https://github.com/ruby/ruby/blob/trunk/signal.c#L946 { check_reserved_signal("SEGV"); CHECK_STACK_OVERFLOW(); - rb_bug_context(SIGINFO_CTX, "Segmentation fault" MESSAGE_FAULT_ADDRESS); + rb_bug_for_fatal_signal(SIGINFO_CTX, "Segmentation fault" MESSAGE_FAULT_ADDRESS); } #endif @@ -961,7 +961,7 @@ sigill(int sig SIGINFO_ARG) https://github.com/ruby/ruby/blob/trunk/signal.c#L961 #if defined __APPLE__ CHECK_STACK_OVERFLOW(); #endif - rb_bug_context(SIGINFO_CTX, "Illegal instruction" MESSAGE_FAULT_ADDRESS); + rb_bug_for_fatal_signal(SIGINFO_CTX, "Illegal instruction" MESSAGE_FAULT_ADDRESS); } #endif diff --git a/vm_core.h b/vm_core.h index 7ff943a..052b1b5 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1624,7 +1624,7 @@ extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1624 #define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp) #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp)) void rb_vm_bugreport(const void *); -NORETURN(void rb_bug_context(const void *, const char *fmt, ...)); +NORETURN(void rb_bug_for_fatal_signal(const void *, const char *fmt, ...)); /* functions about thread/vm execution */ RUBY_SYMBOL_EXPORT_BEGIN -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/