summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_core.h b/vm_core.h
index edf6da1076..6ab3608edd 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1760,7 +1760,7 @@ RUBY_SYMBOL_EXPORT_END
#define GET_VM() rb_current_vm()
#define GET_RACTOR() rb_current_ractor()
#define GET_THREAD() rb_current_thread()
-#define GET_EC() rb_current_execution_context()
+#define GET_EC() rb_current_execution_context(true)
static inline rb_thread_t *
rb_ec_thread_ptr(const rb_execution_context_t *ec)
@@ -1794,7 +1794,7 @@ rb_ec_vm_ptr(const rb_execution_context_t *ec)
}
static inline rb_execution_context_t *
-rb_current_execution_context(void)
+rb_current_execution_context(bool expect_ec)
{
#ifdef RB_THREAD_LOCAL_SPECIFIER
#if __APPLE__
@@ -1805,7 +1805,7 @@ rb_current_execution_context(void)
#else
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
#endif
- VM_ASSERT(ec != NULL);
+ VM_ASSERT(!expect_ec || ec != NULL);
return ec;
}