Skip to content

opted case needs to use updated ints when loaded into new runtime.#8209

Merged
enebo merged 2 commits intojruby:masterfrom
enebo:fix_switch_persist
Apr 25, 2024
Merged

opted case needs to use updated ints when loaded into new runtime.#8209
enebo merged 2 commits intojruby:masterfrom
enebo:fix_switch_persist

Conversation

@enebo
Copy link
Member

@enebo enebo commented Apr 24, 2024

fixes #8157. the int values we calculate are only valid for the runtime they are created in. When loading AOT code we have to generate new int values. This fix just saves the operands we are making the jump table for so we can regenerate new ints from them.

@enebo enebo added this to the JRuby 9.4.7.0 milestone Apr 24, 2024
@enebo enebo merged commit e50cdc1 into jruby:master Apr 25, 2024
@enebo enebo deleted the fix_switch_persist branch April 25, 2024 12:53
headius added a commit to headius/jruby that referenced this pull request Nov 14, 2024
When deserializing a BSwitch we recalculate the values for the
switch based on the new runtime, which mostly means getting new
Symbol IDs. This was fixed in jruby#8209. However we need to ensure
that the jump table is sorted or the binary search for the switch
will sometimes fail.

This patch sorts the related tables based on the new switch values.

Fixes jruby#8421
headius added a commit to headius/jruby that referenced this pull request Nov 14, 2024
When deserializing a BSwitch we recalculate the values for the
switch based on the new runtime, which mostly means getting new
Symbol IDs. This was fixed in jruby#8209. However we need to ensure
that the jump table is sorted or the binary search for the switch
will sometimes fail.

This patch sorts the related tables based on the new switch values.

Fixes jruby#8421
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.

Incorrect case tree selection when comparing Symbols during compiled Ruby code execution

1 participant