-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Hash#{update, merge!} ensure the receiver modifiable [Bug #17736] #4298
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1039,6 +1039,7 @@ ar_update(VALUE hash, st_data_t key, | |||||||||||||
} | ||||||||||||||
old_key = key; | ||||||||||||||
retval = (*func)(&key, &value, arg, existing); | ||||||||||||||
rb_hash_modify(hash); | ||||||||||||||
/* pair can be invalid here because of theap */ | ||||||||||||||
|
||||||||||||||
switch (retval) { | ||||||||||||||
|
@@ -1631,7 +1632,7 @@ rb_hash_tbl(VALUE hash, const char *file, int line) | |||||||||||||
return rb_hash_tbl_raw(hash, file, line); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
static void | ||||||||||||||
void | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this function need to be public? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling in Lines 605 to 610 in db0ad48
|
||||||||||||||
rb_hash_modify(VALUE hash) | ||||||||||||||
{ | ||||||||||||||
rb_hash_modify_check(hash); | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ar_update
is used only for small hashes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮 Oh... I don't know it. Thank you for letting me know! 🙏