Backport #8101

Backport fix for time.send(:initialize) reinitializing and modifying value

Added by Charles Nutter about 1 year ago. Updated 2 months ago.

[ruby-core:53442]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

I filed https://bugs.ruby-lang.org/issues/8099 to get Time to prevent reinitialization, and nobu fixed it in r39766. I am requesting that it be backported to 1.9.3 along with tests I will be adding shortly.

Associated revisions

Revision 40282
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) 39766,39769: [Backport #8101]

* time.c (GetTimeval): check if already initialized instance.

* time.c (GetNewTimeval): check if newly created instance.

* time.c (time_init_0, time_init_1, time_init_copy, time_mload): must
  be newly created instance.   [Bug #8099]

Revision 44844
Added by Tomoyuki Chikanaga 2 months ago

merge revision(s) r42456: [Backport #8101]

* time.c (get_timeval, get_new_timeval): use rb_obj_class()
  instead of CLASS_OF() because CLASS_OF() may return
  a singleton class.

History

#1 Updated by Charles Nutter about 1 year ago

Nevermind about additional tests...I see nobu did add one. So I'd just like to backport that commit to 1.9.3.

#2 Updated by Usaku NAKAMURA about 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA

#3 Updated by Usaku NAKAMURA about 1 year ago

  • Project changed from Backport93 to Backport200
  • Assignee changed from Usaku NAKAMURA to Tomoyuki Chikanaga

Seems to be backported to 2.0.0 first.

#4 Updated by Tomoyuki Chikanaga about 1 year ago

Sorry for my late response. I'll merge r39766 and r39769. r39769 delete broken test by denial of re-initialize Time.

#5 Updated by Tomoyuki Chikanaga about 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40282.
Charles, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39766,39769: [Backport #8101]

* time.c (GetTimeval): check if already initialized instance.

* time.c (GetNewTimeval): check if newly created instance.

* time.c (time_init_0, time_init_1, time_init_copy, time_mload): must
  be newly created instance.   [Bug #8099]

#6 Updated by Tomoyuki Chikanaga about 1 year ago

  • Project changed from Backport200 to Backport93
  • Status changed from Closed to Assigned
  • Assignee changed from Tomoyuki Chikanaga to Usaku NAKAMURA

#7 Updated by Usaku NAKAMURA 11 months ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40711.
Charles, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39766,39769: [Backport #8101]

* time.c (GetTimeval): check if already initialized instance.

* time.c (GetNewTimeval): check if newly created instance.

* time.c (time_init_0, time_init_1, time_init_copy, time_mload): must
  be newly created instance.   [Bug #8099]

#8 Updated by Kazuki Tsujimoto 8 months ago

  • Project changed from Backport93 to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from Usaku NAKAMURA to Tomoyuki Chikanaga

r42456 is related to r39766, so please backport it, too.

#9 Updated by Tomoyuki Chikanaga 2 months ago

  • Status changed from Assigned to Closed

Applied in changeset r44844.


merge revision(s) r42456: [Backport #8101]

* time.c (get_timeval, get_new_timeval): use rb_obj_class()
  instead of CLASS_OF() because CLASS_OF() may return
  a singleton class.

Also available in: Atom PDF