Skip to content

ZJIT: Bug with JIT-to-JIT kwargs #922

@composerinteralia

Description

@composerinteralia

This seems kinda similar to #906, but with kwargs instead of optional args. I haven't had a chance to look too closely, but I'm guessing the second getlocal is reading from the VM stack (because the block changes how we compile getlocal) and the values there are in the wrong order (because they were passed in the opposite direction).

def a(b:, c:)
  if c == :b
    return -> {}
  end

  raise "c is :b!" if c == :b
end

def test
  # note opposite order of kwargs
  a(c: :c, b: :b)
end

test
test

Fails as of 8c7e6f2 with --zjit-call-threshold=2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions