mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add write barrier on tm_from_time->timew
We want to always use time_set_timew, as timew is 64-bit even on 32-bit platforms so we need to be careful to both write that size, but still trigger write barriers if we end up with a heap object.
This commit is contained in:
parent
0e2067dfa7
commit
6b3fa23563
Notes:
git
2025-06-18 17:17:47 +00:00
1 changed files with 4 additions and 2 deletions
6
time.c
6
time.c
|
@ -5800,8 +5800,10 @@ tm_from_time(VALUE klass, VALUE time)
|
|||
tm = time_s_alloc(klass);
|
||||
ttm = RTYPEDDATA_GET_DATA(tm);
|
||||
v = &vtm;
|
||||
GMTIMEW(ttm->timew = tobj->timew, v);
|
||||
ttm->timew = wsub(ttm->timew, v->subsecx);
|
||||
|
||||
WIDEVALUE timew = tobj->timew;
|
||||
GMTIMEW(timew, v);
|
||||
time_set_timew(tm, ttm, wsub(timew, v->subsecx));
|
||||
v->subsecx = INT2FIX(0);
|
||||
v->zone = Qnil;
|
||||
time_set_vtm(tm, ttm, *v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue