Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Don't copy RUBY_FL_PROMOTED flag in rb_obj_setup #9349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 25, 2023

Conversation

peterzhu2118
Copy link
Member

RUBY_FL_PROMOTED is used by the garbage collector to track when an object becomes promoted to the old generation. rb_obj_setup must not copy that flag over because then it may become out-of-sync with the age of the object.

This fixes a bug in Method#clone where the cloned Method object may get RUBY_FL_PROMOTED incorrectly set.

RUBY_FL_PROMOTED is used by the garbage collector to track when an
object becomes promoted to the old generation. rb_obj_setup must not
copy that flag over because then it may become out-of-sync with the age
of the object.

This fixes a bug in Method#clone where the cloned Method object may get
RUBY_FL_PROMOTED incorrectly set.
@peterzhu2118 peterzhu2118 merged commit b4efa4b into ruby:master Dec 25, 2023
@peterzhu2118 peterzhu2118 deleted the obj-setup-promoted branch December 25, 2023 03:13
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