Skip to content

Incorrect caller_locations line for multi-line call with unless #9293

@eregon

Description

@eregon

Environment Information

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
  • Operating system and platform (e.g. uname -a)

jruby 10.0.4.0 (3.4.5) 2026-03-03 9af05b916f OpenJDK 64-Bit Server VM 25.0.2+10 on 25.0.2+10 +indy +jit [x86_64-linux]

Expected Behavior

$ ruby -v -e 'def foo(*); p caller_locations(1, 1)[0]; end; foo "a", "x
y
z" unless false'
ruby 3.4.7 (2025-10-08 revision 7a5688e2a2) +PRISM [x86_64-linux]
"-e:1:in '<main>'"
$ ruby -v -e 'def foo(*); p caller_locations(1, 1)[0]; end; foo "a", "x
y
z" unless false'
truffleruby 33.0.1 (2026-01-20), like ruby 3.3.7, Oracle GraalVM Native [x86_64-linux]
"-e:1:in `<main>'"

Actual Behavior

$ ruby -v -e 'def foo(*); p caller_locations(1, 1)[0]; end; foo "a", "x
y
z" unless false'
jruby 10.0.4.0 (3.4.5) 2026-03-03 9af05b916f OpenJDK 64-Bit Server VM 25.0.2+10 on 25.0.2+10 +indy +jit [x86_64-linux]
"-e:3:in '<main>'"

This makes it annoying to exclude failing tests for https://github.com/eregon/ractor-shim because I have to manually comment out every such if/unless or JRuby will incorrectly execute the ignored test due to reporting the wrong line number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions