Skip to content

Rest args dup keyword hash#8556

Merged
enebo merged 1 commit intojruby:10-devfrom
enebo:fix_restarg_kwarg
Jan 5, 2025
Merged

Rest args dup keyword hash#8556
enebo merged 1 commit intojruby:10-devfrom
enebo:fix_restarg_kwarg

Conversation

@enebo
Copy link
Member

@enebo enebo commented Jan 5, 2025

This fix is ugly but in recv_keyword we will notice that it is not really a keyword but an element of a rest arg. In that case we will dup the kwarg into a normal hash argument.

The ugly part is this is handled while processing kwargs but if I went to figure out how this worked I would think the logic would be in recv_rest_arg. Unfortunately, we no longer have the info available by that point (and honestly it would be painful to propagate to a later instruction).

This fix is ugly but in recv_keyword we will notice that it is not
really a keyword but an element of a rest arg.  In that case we will
dup the kwarg into a normal hash argument.

The ugly part is this is handled while processing kwargs but if I
went to figure out how this worked I would think the logic would be
in recv_rest_arg.  Unfortunately, we no longer have the info available
by that point (and honestly it would be painful to propagate to a later
instruction).
@enebo enebo added this to the JRuby 10.0.0.0 milestone Jan 5, 2025
@enebo enebo merged commit 6bc1bf6 into jruby:10-dev Jan 5, 2025
54 of 72 checks passed
@enebo enebo deleted the fix_restarg_kwarg branch January 5, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant