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 72e2bcb6fb..52baa401e2 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1777,7 +1777,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)
@@ -1811,7 +1811,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
#ifdef __APPLE__
@@ -1822,7 +1822,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;
}