Skip to content

Commit d869164

Browse files
luke-gruberjhawthorn
authored andcommitted
rb_bug shouldn't assume ec is available (don't use GET_EC())
ec is unavailable on timer thread, for instance.
1 parent 48eb907 commit d869164

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

error.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ rb_bug_without_die_internal(const char *fmt, va_list args)
10901090
const char *file = NULL;
10911091
int line = 0;
10921092

1093-
if (GET_EC()) {
1093+
if (rb_current_execution_context(false)) {
10941094
file = rb_source_location_cstr(&line);
10951095
}
10961096

@@ -1123,7 +1123,7 @@ rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const voi
11231123
const char *file = NULL;
11241124
int line = 0;
11251125

1126-
if (GET_EC()) {
1126+
if (rb_current_execution_context(false)) {
11271127
file = rb_source_location_cstr(&line);
11281128
}
11291129

0 commit comments

Comments
 (0)