diff options
author | Peter Zhu <[email protected]> | 2024-10-31 11:34:09 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2024-10-31 13:52:24 -0400 |
commit | 645a0c9ea73dd3a89c3c7f75a64dc7e1760ee936 (patch) | |
tree | 05193efeb17b0301dee6c4de28bf56615d471fdb | |
parent | 843b4f49ee82c572405d466f28d4305e21d6e6c2 (diff) |
Remove vm_assert_env
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11970
-rw-r--r-- | vm.c | 2 | ||||
-rw-r--r-- | vm_core.h | 11 |
2 files changed, 2 insertions, 11 deletions
@@ -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); } @@ -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; } |