summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm.c2
-rw-r--r--vm_core.h11
2 files changed, 2 insertions, 11 deletions
diff --git a/vm.c b/vm.c
index 5b1fa5091e..93579e86fe 100644
--- a/vm.c
+++ b/vm.c
@@ -171,7 +171,7 @@ vm_ep_in_heap_p_(const rb_execution_context_t *ec, const VALUE *ep)
if (!UNDEF_P(envval)) {
const rb_env_t *env = (const rb_env_t *)envval;
- VM_ASSERT(vm_assert_env(envval));
+ VM_ASSERT(imemo_type_p(envval, imemo_env));
VM_ASSERT(VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED));
VM_ASSERT(env->ep == ep);
}
diff --git a/vm_core.h b/vm_core.h
index e5169685f1..627f437883 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1489,22 +1489,13 @@ VM_ENV_ESCAPED_P(const VALUE *ep)
return VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED) ? 1 : 0;
}
-#if VM_CHECK_MODE > 0
-static inline int
-vm_assert_env(VALUE obj)
-{
- VM_ASSERT(obj == Qundef || imemo_type_p(obj, imemo_env));
- return 1;
-}
-#endif
-
RBIMPL_ATTR_NONNULL((1))
static inline VALUE
VM_ENV_ENVVAL(const VALUE *ep)
{
VALUE envval = ep[VM_ENV_DATA_INDEX_ENV];
VM_ASSERT(VM_ENV_ESCAPED_P(ep));
- VM_ASSERT(vm_assert_env(envval));
+ VM_ASSERT(envval == Qundef || imemo_type_p(envval, imemo_env));
return envval;
}