diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-09-07 14:56:07 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-09-12 11:25:07 -0400 |
commit | 39ee3e22bd3d071c1c283b6b8dbd1af413342fb1 (patch) | |
tree | da6a4f4c93d1887d477776b7f4575d5146f702e4 /vm_core.h | |
parent | b90272b3b661bd2fd557332028b8feb568b6b9df (diff) |
Make Kernel#lambda raise when given non-literal block
Previously, Kernel#lambda returned a non-lambda proc when given a
non-literal block and issued a warning under the `:deprecated` category.
With this change, Kernel#lambda will always return a lambda proc, if it
returns without raising.
Due to interactions with block passing optimizations, we previously had
two separate code paths for detecting whether Kernel#lambda got a
literal block. This change allows us to remove one path, the hack done
with rb_control_frame_t::block_code introduced in 85a337f for supporting
situations where Kernel#lambda returned a non-lambda proc.
[Feature #19777]
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8405
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -1550,12 +1550,6 @@ vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler)) (vm_block_handler_type(block_handler), 1)); } -static inline int -vm_cfp_forwarded_bh_p(const rb_control_frame_t *cfp, VALUE block_handler) -{ - return ((VALUE) cfp->block_code) == block_handler; -} - static inline enum rb_block_type vm_block_type(const struct rb_block *block) { |