pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jruby/jruby/pull/9355

com/assets/global-0bd78641c0a1f3e0.css" /> Propagate newline from if to bodies by headius · Pull Request #9355 · jruby/jruby · GitHub
Skip to content

Propagate newline from if to bodies#9355

Open
headius wants to merge 1 commit intojruby:jruby-10.0from
headius:if_modifier_line_fix
Open

Propagate newline from if to bodies#9355
headius wants to merge 1 commit intojruby:jruby-10.0from
headius:if_modifier_line_fix

Conversation

@headius
Copy link
Copy Markdown
Member

@headius headius commented Mar 31, 2026

This is a somewhat form-fitted fix for #9293 that only assists with line numbers of the then and else bodies of IfNode. In the linked issue, a trailing if or unless modifier will be used as the line number that an associated call gets associated with, causing stack output like from caller_locations to be incorrect. In CRuby, this newline propagation appears to be done during the reduce_nodes function, but that function has many side effects in its macro-heavy logic and an initial attempt to port it did not fix the issue in question. Instead, I just detect this specific case and propagate the newline manually.

There may be other such cases, and once we encounter those there may be a better justification for formally duplicating the newline side-effect logic from reduce_node. For now, this quick fix is probably good enough.

Fixes #9293

@headius headius added this to the JRuby 10.0.5.0 milestone Mar 31, 2026
This is a somewhat form-fitted fix for jruby#9293 that only
assists with line numbers of the then and else bodies of IfNode. In
the linked issue, a trailing `if` or `unless` modifier will be used
as the line number that an associated call gets associated with,
causing stack output like from `caller_locations` to be incorrect.
In CRuby, this newline propagation appears to be done during the
`reduce_nodes` function, but that function has many side effects
in its macro-heavy logic and an initial attempt to port it did not
fix the issue in question. Instead, I just detect this specific
case and propagate the newline manually.

There may be other such cases, and once we encounter those there
may be a better justification for formally duplicating the newline
side-effect logic from `reduce_node`. For now, this quick fix is
probably good enough.

Fixes jruby#9293
@headius headius force-pushed the if_modifier_line_fix branch from cdf17ef to 31d1685 Compare April 1, 2026 13:41
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

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy