зеркало из https://github.com/github/ruby.git
[PRISM] Set use_block parameter flag for forwardable methods
Match logic in compile.c:2133. Without this, the unused block warning code allocates an array, causing TestAllocation to fail.
This commit is contained in:
Родитель
dba9601e0f
Коммит
c3ffa7106b
|
@ -8671,6 +8671,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
if (PM_NODE_TYPE_P(parameters_node->keyword_rest, PM_FORWARDING_PARAMETER_NODE)) {
|
||||
// Only optimize specifically methods like this: `foo(...)`
|
||||
if (requireds_list->size == 0 && optionals_list->size == 0 && keywords_list->size == 0) {
|
||||
ISEQ_BODY(iseq)->param.flags.use_block = TRUE;
|
||||
ISEQ_BODY(iseq)->param.flags.forwardable = TRUE;
|
||||
table_size += 1;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче