diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-09-05 17:31:00 +0900 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-09-05 17:47:12 -0700 |
commit | eda8dcea164b561359f638b1489d0ab12659c9a2 (patch) | |
tree | 281432ea0bb27a7e6709a9f55e316890924a07cb /vm_insnhelper.c | |
parent | 0bfe3bf4d1a2cf6659a99c7466c733cf922ee0e0 (diff) |
Add a comment that some ci->flag is inconsistent after CALLER_SETUP_ARG
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index baf99c4d66..55369c7cd9 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1743,12 +1743,22 @@ CALLER_SETUP_ARG(struct rb_control_frame_struct *restrict cfp, const struct rb_call_info *restrict ci, int remove_empty_keyword_hash) { if (UNLIKELY(IS_ARGS_SPLAT(ci))) { + /* This expands the rest argument to the stack. + * So, ci->flag & VM_CALL_ARGS_SPLAT is now inconsistent. + */ vm_caller_setup_arg_splat(cfp, calling); } if (UNLIKELY(IS_ARGS_KEYWORD(ci))) { + /* This converts VM_CALL_KWARG style to VM_CALL_KW_SPLAT style + * by creating a keyword hash. + * So, ci->flag & VM_CALL_KWARG is now inconsistent. + */ vm_caller_setup_arg_kw(cfp, calling, ci); } if (UNLIKELY(calling->kw_splat && remove_empty_keyword_hash)) { + /* This removes the last Hash object if it is empty. + * So, ci->flag & VM_CALL_KW_SPLAT is now inconsistent. + */ if (RHASH_EMPTY_P(cfp->sp[-1])) { cfp->sp--; calling->argc--; |