Skip to content

[GR-73856] Ensure synthetic SourceRanges map to unavailable sections.#669

Merged
graalvmbot merged 2 commits intomasterfrom
mdsouza/GR-73856
Mar 5, 2026
Merged

[GR-73856] Ensure synthetic SourceRanges map to unavailable sections.#669
graalvmbot merged 2 commits intomasterfrom
mdsouza/GR-73856

Conversation

@graalvmbot
Copy link
Collaborator

This issue came up in an insight gate in the Graal repo. When parsed with args (as it is when insight is enabled), Python augments the module AST as:

def execute(args):
  <module body>

execute

using SourceRange.ARTIFICIAL_RANGE for the injected nodes. These ranges do not map to any meaningful source section, so SourceSection creation can fail. This change maps SourceRange.ARTIFICIAL_RANGE to an unavailable section.

For the "statement" of a function declaration we create a special source range with the length of the function name (using startLineShiftColumn), which also needs special handling for ARTIFICIAL_RANGE.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 5, 2026
@graalvmbot graalvmbot closed this Mar 5, 2026
@graalvmbot graalvmbot merged commit a108fb4 into master Mar 5, 2026
9 of 12 checks passed
@graalvmbot graalvmbot deleted the mdsouza/GR-73856 branch March 5, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants