Skip to content

Fix #7815. NullPointerException for compiled code with for loop#7948

Merged
enebo merged 2 commits intojruby:masterfrom
enebo:fix_7815
Oct 6, 2023
Merged

Fix #7815. NullPointerException for compiled code with for loop#7948
enebo merged 2 commits intojruby:masterfrom
enebo:fix_7815

Conversation

@enebo
Copy link
Member

@enebo enebo commented Oct 5, 2023

AOT code encodes IR into the .class file and it was not correctly adjusting local variable operands to account for for loops. The code before the fix would count all possible for loops and not just the for loops between the current accessing scope and the destination scope.

Added a single test which has a complicated set of variable accesses which should exercise the depth adjustment which was fixed in this commit.

AOT code encodes IR into the .class file and it was not correctly
adjusting local variable operands to account for `for` loops.  The
code before the fix would count all possible `for` loops and not
just the `for` loops between the current accessing scope and the
destination scope.

Added a single test which has a complicated set of variable accesses
which should exercise the depth adjustment which was fixed in this
commit.
@enebo enebo added the ir label Oct 5, 2023
@enebo enebo added this to the JRuby 9.4.4.0 milestone Oct 5, 2023
@enebo enebo merged commit 49827ad into jruby:master Oct 6, 2023
@enebo enebo deleted the fix_7815 branch March 4, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant