summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Gruber <luke.gruber@shopify.com>2025-09-24 10:33:25 -0400
committerJohn Hawthorn <john@hawthorn.email>2025-09-24 10:41:04 -0700
commitd869164124cfca347c30c19c85947a69cee03db8 (patch)
tree54ab22ea233530d248d75ed9336d8f70695ddfda
parent48eb907f6bbf17e7a5ad1a4e68b7843cd2a3ccb7 (diff)
rb_bug shouldn't assume ec is available (don't use GET_EC())
ec is unavailable on timer thread, for instance.
-rw-r--r--error.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/error.c b/error.c
index e07c99e6df..c510432c9d 100644
--- a/error.c
+++ b/error.c
@@ -1090,7 +1090,7 @@ rb_bug_without_die_internal(const char *fmt, va_list args)
const char *file = NULL;
int line = 0;
- if (GET_EC()) {
+ if (rb_current_execution_context(false)) {
file = rb_source_location_cstr(&line);
}
@@ -1123,7 +1123,7 @@ rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const voi
const char *file = NULL;
int line = 0;
- if (GET_EC()) {
+ if (rb_current_execution_context(false)) {
file = rb_source_location_cstr(&line);
}