8000 Splat with multi-line expression improperly expands · Issue #8830 · jruby/jruby · GitHub
[go: up one dir, main page]

Skip to content
Splat with multi-line expression improperly expands #8830
@headius

Description

@headius

The following method call improperly captures the result of "baz" and passes it and the result of "bar" as the 2nd and 3rd arguments:

def foo(a, b, c, d)
  p [a, b, c, d]
end
def bar = [1, 2]
def baz = 6
foo(0, *(baz; bar), 3)

This should output [0, 1, 2, 3] but instead it outputs [0, 6, [1, 2], 3].

It affects both 9.4 and 10, in both interpreter and JIT, so it appears to be a bug in IR compilation.

This causes most net-imap tests to fail because of the following line:

https://github.com/ruby/net-imap/blob/e58aff64d55dda4215fa0cfd7f4d1ea7b9ca51ba/lib/net/imap/response_parser.rb#L804

The TaggedResponse gets initialized with bogus values, which causes the imap client to terminate early because the response is not valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0