<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_time.rb, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 5d4fff845602872eef072e7611558b5f8762efe0: [Backport #19293]</title>
<updated>2023-07-23T03:20:12+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-07-23T03:20:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0b3ed6043c9d091d499ca1caed604a983c7e285b'/>
<id>0b3ed6043c9d091d499ca1caed604a983c7e285b</id>
<content type='text'>
	Tighten Time.new(string) parsing

	Disallow:

	* Only year-month
	* Only year-month-day
	* Preceding whitespace
	* Trailing whitespace

	Fixes [Bug #19293]
	---
	 test/ruby/test_time.rb | 13 +++++++++++++
	 time.c                 | 13 ++++++++++++-
	 2 files changed, 25 insertions(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Tighten Time.new(string) parsing

	Disallow:

	* Only year-month
	* Only year-month-day
	* Preceding whitespace
	* Trailing whitespace

	Fixes [Bug #19293]
	---
	 test/ruby/test_time.rb | 13 +++++++++++++
	 time.c                 | 13 ++++++++++++-
	 2 files changed, 25 insertions(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) a84c99468f26a9f79fec57926d561ed906505eac: [Backport #19575]</title>
<updated>2023-07-17T00:45:57+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-07-17T00:45:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cb8d656100659eaee44042ca680886c30892df04'/>
<id>cb8d656100659eaee44042ca680886c30892df04</id>
<content type='text'>
	Fix crash in Time on 32-bit systems

	[Bug #19575]

	struct vtm is packed causing it to have a size that is not aligned on
	32-bit systems. When allocating it on the stack, it will have unaligned
	addresses which means that the fields won't be marked by the GC when
	scanning the stack (since the GC only marks aligned addresses). This can
	cause crashes when the fields are heap allocated objects like Bignums.

	This commit moves the flags in struct time_object into struct vtm for
	space efficiency and removes the need for packing.

	This is an example of a crash:

	    ruby(rb_print_backtrace+0xd) [0x56848945] ../src/vm_dump.c:785
	    ruby(rb_vm_bugreport) ../src/vm_dump.c:1101
	    ruby(rb_assert_failure+0x7a) [0x56671857] ../src/error.c:878
	    ruby(vm_search_cc+0x0) [0x56666e47] ../src/vm_method.c:1366
	    ruby(rb_vm_search_method_slowpath) ../src/vm_insnhelper.c:2090
	    ruby(callable_method_entry+0x5) [0x568232d3] ../src/vm_method.c:1406
	    ruby(rb_callable_method_entry) ../src/vm_method.c:1413
	    ruby(gccct_method_search_slowpath) ../src/vm_eval.c:427
	    ruby(gccct_method_search+0x20f) [0x568237ef] ../src/vm_eval.c:476
	    ruby(opt_equality_by_mid_slowpath+0x2c) [0x5682388c] ../src/vm_insnhelper.c:2338
	    ruby(rb_equal+0x37) [0x566fe577] ../src/object.c:133
	    ruby(rb_big_eq+0x34) [0x56876ee4] ../src/bignum.c:5554
	    ruby(rb_int_equal+0x14) [0x566f3ed4] ../src/numeric.c:4640
	    ruby(rb_int_equal) ../src/numeric.c:4634
	    ruby(vm_call0_cfunc_with_frame+0x6d) [0x568303c2] ../src/vm_eval.c:148
	    ruby(vm_call0_cfunc) ../src/vm_eval.c:162
	    ruby(vm_call0_body) ../src/vm_eval.c:208
	    ruby(rb_funcallv_scope+0xd1) [0x56833971] ../src/vm_eval.c:85
	    ruby(RB_TEST+0x0) [0x567e8488] ../src/time.c:78
	    ruby(eq) ../src/time.c:78
	    ruby(small_vtm_sub) ../src/time.c:1523
	    ruby(timelocalw+0x23b) [0x567f3e9b] ../src/time.c:1593
	    ruby(time_s_alloc+0x0) [0x567f536b] ../src/time.c:3698
	    ruby(time_new_timew) ../src/time.c:2694
	    ruby(time_s_mktime) ../src/time.c:3698
	---
	 test/ruby/test_time.rb |  7 ++-----
	 time.c                 | 57 ++++++++++++++++++++++++--------------------------
	 timev.h                |  7 +++++--
	 3 files changed, 34 insertions(+), 37 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix crash in Time on 32-bit systems

	[Bug #19575]

	struct vtm is packed causing it to have a size that is not aligned on
	32-bit systems. When allocating it on the stack, it will have unaligned
	addresses which means that the fields won't be marked by the GC when
	scanning the stack (since the GC only marks aligned addresses). This can
	cause crashes when the fields are heap allocated objects like Bignums.

	This commit moves the flags in struct time_object into struct vtm for
	space efficiency and removes the need for packing.

	This is an example of a crash:

	    ruby(rb_print_backtrace+0xd) [0x56848945] ../src/vm_dump.c:785
	    ruby(rb_vm_bugreport) ../src/vm_dump.c:1101
	    ruby(rb_assert_failure+0x7a) [0x56671857] ../src/error.c:878
	    ruby(vm_search_cc+0x0) [0x56666e47] ../src/vm_method.c:1366
	    ruby(rb_vm_search_method_slowpath) ../src/vm_insnhelper.c:2090
	    ruby(callable_method_entry+0x5) [0x568232d3] ../src/vm_method.c:1406
	    ruby(rb_callable_method_entry) ../src/vm_method.c:1413
	    ruby(gccct_method_search_slowpath) ../src/vm_eval.c:427
	    ruby(gccct_method_search+0x20f) [0x568237ef] ../src/vm_eval.c:476
	    ruby(opt_equality_by_mid_slowpath+0x2c) [0x5682388c] ../src/vm_insnhelper.c:2338
	    ruby(rb_equal+0x37) [0x566fe577] ../src/object.c:133
	    ruby(rb_big_eq+0x34) [0x56876ee4] ../src/bignum.c:5554
	    ruby(rb_int_equal+0x14) [0x566f3ed4] ../src/numeric.c:4640
	    ruby(rb_int_equal) ../src/numeric.c:4634
	    ruby(vm_call0_cfunc_with_frame+0x6d) [0x568303c2] ../src/vm_eval.c:148
	    ruby(vm_call0_cfunc) ../src/vm_eval.c:162
	    ruby(vm_call0_body) ../src/vm_eval.c:208
	    ruby(rb_funcallv_scope+0xd1) [0x56833971] ../src/vm_eval.c:85
	    ruby(RB_TEST+0x0) [0x567e8488] ../src/time.c:78
	    ruby(eq) ../src/time.c:78
	    ruby(small_vtm_sub) ../src/time.c:1523
	    ruby(timelocalw+0x23b) [0x567f3e9b] ../src/time.c:1593
	    ruby(time_s_alloc+0x0) [0x567f536b] ../src/time.c:3698
	    ruby(time_new_timew) ../src/time.c:2694
	    ruby(time_s_mktime) ../src/time.c:3698
	---
	 test/ruby/test_time.rb |  7 ++-----
	 time.c                 | 57 ++++++++++++++++++++++++--------------------------
	 timev.h                |  7 +++++--
	 3 files changed, 34 insertions(+), 37 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 3f54d09a5b8b6e4fd734abc8911e170d5967b5b0: [Backport #19390]</title>
<updated>2023-01-31T04:39:13+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2023-01-31T04:39:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5a2b28909ece2e1310250180f097bfcb7b0203dc'/>
<id>5a2b28909ece2e1310250180f097bfcb7b0203dc</id>
<content type='text'>
	bignum.c: rb_int_parse_cstr handle `0` strings

	[Bug #19390]

	We shouldn't check the string length when skipping zeros, as the
	string might only contains zero characters, resulting in an empty string.
	---
	 bignum.c               | 1 -
	 test/ruby/test_time.rb | 4 ++++
	 2 files changed, 4 insertions(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	bignum.c: rb_int_parse_cstr handle `0` strings

	[Bug #19390]

	We shouldn't check the string length when skipping zeros, as the
	string might only contains zero characters, resulting in an empty string.
	---
	 bignum.c               | 1 -
	 test/ruby/test_time.rb | 4 ++++
	 2 files changed, 4 insertions(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 291a4098cf649c027cb50c16b872455f26ad1dfb,5be0d42d2c4dc765230c76738289560f9ee37f09: [Backport #19296]</title>
<updated>2023-01-18T08:17:27+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2023-01-18T08:17:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=52ea5ea9906c3a96c60a68e01b303672602a6832'/>
<id>52ea5ea9906c3a96c60a68e01b303672602a6832</id>
<content type='text'>
	Add missing assertion

	---
	 test/ruby/test_time.rb | 3 +++
	 1 file changed, 3 insertions(+)

	[Bug #19296] Precheck bits of time components

	---
	 test/ruby/test_time.rb | 15 +++++++++++++++
	 time.c                 | 14 ++++++++------
	 2 files changed, 23 insertions(+), 6 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Add missing assertion

	---
	 test/ruby/test_time.rb | 3 +++
	 1 file changed, 3 insertions(+)

	[Bug #19296] Precheck bits of time components

	---
	 test/ruby/test_time.rb | 15 +++++++++++++++
	 time.c                 | 14 ++++++++------
	 2 files changed, 23 insertions(+), 6 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 542e984d82fa25098eb15398d716d907acc52b93: [Backport #19292]</title>
<updated>2023-01-17T02:21:00+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2023-01-17T02:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89cd61890fe78e0491708f87a5df678b03fda8a3'/>
<id>89cd61890fe78e0491708f87a5df678b03fda8a3</id>
<content type='text'>
	[Bug #19292] Re-initialize tm when wday or yday is not set

	---
	 test/ruby/test_time.rb |  3 ++-
	 time.c                 | 31 ++++++++++++++++++++++---------
	 2 files changed, 24 insertions(+), 10 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #19292] Re-initialize tm when wday or yday is not set

	---
	 test/ruby/test_time.rb |  3 ++-
	 time.c                 | 31 ++++++++++++++++++++++---------
	 2 files changed, 24 insertions(+), 10 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #18033] Parse more strictly conformant with ISO-8601</title>
<updated>2022-12-16T13:52:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-11-18T05:18:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3e49d62bc1696a7943e4407328714e32b539b007'/>
<id>3e49d62bc1696a7943e4407328714e32b539b007</id>
<content type='text'>
* 4-digits or more is required as year
* Minutes and seconds parts are not ommittable
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 4-digits or more is required as year
* Minutes and seconds parts are not ommittable
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #18033] Add `precision:` option</title>
<updated>2022-12-16T13:52:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-10-23T14:32:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9515179d74f2d9934c1b2c69879d72254d940f85'/>
<id>9515179d74f2d9934c1b2c69879d72254d940f85</id>
<content type='text'>
Which limits the precision of subsecond. Defaulted to 9, that
means nanosecond.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Which limits the precision of subsecond. Defaulted to 9, that
means nanosecond.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #18033] More strict checks</title>
<updated>2022-12-16T13:52:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-09-19T05:06:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=67c589afa05b1a894ed07969bec16647eff4e593'/>
<id>67c589afa05b1a894ed07969bec16647eff4e593</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #18033] Make Time.new parse time strings</title>
<updated>2022-12-16T13:52:59+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-09-04T15:24:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8c272f44816f098c1e057c72a47451efc8cd1739'/>
<id>8c272f44816f098c1e057c72a47451efc8cd1739</id>
<content type='text'>
`Time.new` now parses strings such as the result of `Time#inspect`
and restricted ISO-8601 formats.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Time.new` now parses strings such as the result of `Time#inspect`
and restricted ISO-8601 formats.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Time#deconstruct_keys</title>
<updated>2022-11-22T21:10:46+00:00</updated>
<author>
<name>zverok</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2022-10-19T19:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eaf2b6c4396ff19921cbc75a394d7a752aaab4ef'/>
<id>eaf2b6c4396ff19921cbc75a394d7a752aaab4ef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
