diff options
author | 卜部昌平 <[email protected]> | 2020-07-06 14:58:57 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2020-07-10 12:23:41 +0900 |
commit | 4b8170ce8027863b2085c105f4c4aaad0489328b (patch) | |
tree | 0568209092e798d9b8a6578589f89caf13ebdf47 /vm_insnhelper.c | |
parent | 1d93705d6a76f805d1ca5153cb5f4c59ce58c754 (diff) |
vm_push_frame: move assertions out of the function
These assertions are purely static. Ned not be checked on-the-fly.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3296
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6d4bc5bedc..fffe5407fe 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -327,6 +327,10 @@ vm_push_frame_debug_counter_inc( #define vm_push_frame_debug_counter_inc(ec, cfp, t) /* void */ #endif +STATIC_ASSERT(VM_ENV_DATA_INDEX_ME_CREF, VM_ENV_DATA_INDEX_ME_CREF == -2); +STATIC_ASSERT(VM_ENV_DATA_INDEX_SPECVAL, VM_ENV_DATA_INDEX_SPECVAL == -1); +STATIC_ASSERT(VM_ENV_DATA_INDEX_FLAGS, VM_ENV_DATA_INDEX_FLAGS == -0); + static void vm_push_frame(rb_execution_context_t *ec, const rb_iseq_t *iseq, @@ -364,9 +368,6 @@ vm_push_frame(rb_execution_context_t *ec, } /* setup ep with managing data */ - VM_ASSERT(VM_ENV_DATA_INDEX_ME_CREF == -2); - VM_ASSERT(VM_ENV_DATA_INDEX_SPECVAL == -1); - VM_ASSERT(VM_ENV_DATA_INDEX_FLAGS == -0); *sp++ = cref_or_me; /* ep[-2] / Qnil or T_IMEMO(cref) or T_IMEMO(ment) */ *sp++ = specval /* ep[-1] / block handler or prev env ptr */; *sp = type; /* ep[-0] / ENV_FLAGS */ |