<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/symbol.c, 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>[Bug #21629] Initialize `struct RString`</title>
<updated>2026-01-22T09:02:29+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-10-08T09:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=357d601e8b44b2d2b99ffaf05f6912c4c705c4e6'/>
<id>357d601e8b44b2d2b99ffaf05f6912c4c705c4e6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress gcc 15 unterminated-string-initialization warnings</title>
<updated>2025-07-24T05:39:20+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-04-30T09:35:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e26e8423b5b8a375a8fd6412a99eb6a8cc73cf2c'/>
<id>e26e8423b5b8a375a8fd6412a99eb6a8cc73cf2c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 79eb75a8dd64848f23e9efc465f06326b5d4b680: [Backport #20025]</title>
<updated>2025-03-13T05:27:06+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2025-03-13T04:29:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=998c26cd28e225b701aee00ad8f91694ba7d383a'/>
<id>998c26cd28e225b701aee00ad8f91694ba7d383a</id>
<content type='text'>
	[Bug #20025] Check if upper/lower before fallback to case-folding
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20025] Check if upper/lower before fallback to case-folding
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) ac0163949a6ee678dfccec9f6e56422b91e5f0a9,01fd262e62076277a41af72ea13f20deb1b462a2: [Backport #20245]</title>
<updated>2024-03-31T08:37:01+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2024-03-31T08:37:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=27606daf8efeb0ae6d0590a2c9bb1c5aae07f140'/>
<id>27606daf8efeb0ae6d0590a2c9bb1c5aae07f140</id>
<content type='text'>
	Compile code without Symbol GC always

	---
	 symbol.c | 28 +++++++++++++---------------
	 1 file changed, 13 insertions(+), 15 deletions(-)

	Fix crash when checking symbol encoding

	[Bug #20245]

	We sometimes pass in a fake string to sym_check_asciionly. This can crash
	if sym_check_asciionly raises because it creates a CFP with the fake
	string as the receiver which will crash if GC tries to mark the CFP.

	For example, the following script crashes:

	    GC.stress = true
	    Object.const_defined?("\xC3")
	---
	 symbol.c                 | 17 ++++++++++-------
	 test/ruby/test_module.rb |  8 ++++++++
	 2 files changed, 18 insertions(+), 7 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Compile code without Symbol GC always

	---
	 symbol.c | 28 +++++++++++++---------------
	 1 file changed, 13 insertions(+), 15 deletions(-)

	Fix crash when checking symbol encoding

	[Bug #20245]

	We sometimes pass in a fake string to sym_check_asciionly. This can crash
	if sym_check_asciionly raises because it creates a CFP with the fake
	string as the receiver which will crash if GC tries to mark the CFP.

	For example, the following script crashes:

	    GC.stress = true
	    Object.const_defined?("\xC3")
	---
	 symbol.c                 | 17 ++++++++++-------
	 test/ruby/test_module.rb |  8 ++++++++
	 2 files changed, 18 insertions(+), 7 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Rewrite Symbol#to_sym and #intern in Ruby (#6683)</title>
<updated>2022-11-16T05:34:30+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-11-16T05:34:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e7443dbbcaf82eee200d33a5c3bc374ad9eec8a7'/>
<id>e7443dbbcaf82eee200d33a5c3bc374ad9eec8a7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement optimize send in yjit (#6488)</title>
<updated>2022-10-11T20:37:05+00:00</updated>
<author>
<name>Jimmy Miller</name>
<email>jimmy.miller@shopify.com</email>
</author>
<published>2022-10-11T20:37:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=467992ee35b59577ddb53f1323b19af3f3e3d134'/>
<id>467992ee35b59577ddb53f1323b19af3f3e3d134</id>
<content type='text'>
* Implement optimize send in yjit

This successfully makes all our benchmarks exit way less for optimize send reasons.
It makes some benchmarks faster, but not by as much as I'd like. I think this implementation
works, but there are definitely more optimial arrangements. For example, what if we compiled
send to a jump table? That seems like perhaps the most optimal we could do, but not obvious (to me)
how to implement give our current setup.

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* Attempt at fixing the issues raised by @XrXr

* fix allowlist

* returns 0 instead of nil when not found

* remove comment about encoding exception

* Fix up c changes

* Update assert

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* get rid of unneeded code and fix the flags

* Apply suggestions from code review

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* rename and fix typo

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Implement optimize send in yjit

This successfully makes all our benchmarks exit way less for optimize send reasons.
It makes some benchmarks faster, but not by as much as I'd like. I think this implementation
works, but there are definitely more optimial arrangements. For example, what if we compiled
send to a jump table? That seems like perhaps the most optimal we could do, but not obvious (to me)
how to implement give our current setup.

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* Attempt at fixing the issues raised by @XrXr

* fix allowlist

* returns 0 instead of nil when not found

* remove comment about encoding exception

* Fix up c changes

* Update assert

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* get rid of unneeded code and fix the flags

* Apply suggestions from code review

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;

* rename and fix typo

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Rename rb_ary_tmp_new to rb_ary_hidden_new</title>
<updated>2022-07-26T13:12:09+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-07-25T14:40:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=efb91ff19b739b759f40af2673f942e80d212857'/>
<id>efb91ff19b739b759f40af2673f942e80d212857</id>
<content type='text'>
rb_ary_tmp_new suggests that the array is temporary in some way, but
that's not true, it just creates an array that's hidden and not on the
transient heap. This commit renames it to rb_ary_hidden_new.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rb_ary_tmp_new suggests that the array is temporary in some way, but
that's not true, it just creates an array that's hidden and not on the
transient heap. This commit renames it to rb_ary_hidden_new.
</pre>
</div>
</content>
</entry>
<entry>
<title>Expand tabs [ci skip]</title>
<updated>2022-07-21T16:42:04+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2022-07-21T16:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5b21e94bebed90180d8ff63dad03b8b948361089'/>
<id>5b21e94bebed90180d8ff63dad03b8b948361089</id>
<content type='text'>
[Misc #18891]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Misc #18891]
</pre>
</div>
</content>
</entry>
<entry>
<title>Ensure _id2ref finds symbols with the correct type</title>
<updated>2022-07-20T17:38:44+00:00</updated>
<author>
<name>Daniel Colson</name>
<email>danieljamescolson@gmail.com</email>
</author>
<published>2022-07-03T00:28:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=32e406d6d3c3ded9160298c4475c1aa188360b07'/>
<id>32e406d6d3c3ded9160298c4475c1aa188360b07</id>
<content type='text'>
Prior to this commit it was possible to call `ObjectSpace._id2ref` with
an offset static symbol object_id and get back a new, incorrectly tagged
symbol:

```
&gt; sensible_sym = ObjectSpace._id2ref(:a.object_id)
=&gt; :a
&gt; nonsense_sym = ObjectSpace._id2ref(:a.object_id + 40)
=&gt; :a
&gt; sensible_sym == nonsense_sym
=&gt; false
```

`nonsense_sym` ends up tagged with `RUBY_ID_INSTANCE` instead of
`RB_ID_LOCAL`. That means we can do silly things like:

```
&gt; foo = Object.new
&gt; foo.instance_variable_set(:a, 123)
(irb):2:in `instance_variable_set': `a' is not allowed as an instance variable name (NameError)
&gt; foo.instance_variable_set(ObjectSpace._id2ref(:a.object_id + 40), 123)
=&gt; 123
&gt; foo.instance_variables
=&gt; [:a]
```

This was happening because `get_id_entry` ignores the tag bits when
looking up the symbol. So `rb_id2str(symid)` would return a value and
then we'd continue on with the nonsense `symid`.

This commit prevents the situation by checking that the `symid` actually
matches what we get back from `get_id_entry`. Now we get a `RangeError`
for the nonsense id:

```
&gt; ObjectSpace._id2ref(:a.object_id)
=&gt; :a
&gt; ObjectSpace._id2ref(:a.object_id + 40)
(irb):1:in `_id2ref': 0x000000000013f408 is not symbol id value (RangeError)
```

Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prior to this commit it was possible to call `ObjectSpace._id2ref` with
an offset static symbol object_id and get back a new, incorrectly tagged
symbol:

```
&gt; sensible_sym = ObjectSpace._id2ref(:a.object_id)
=&gt; :a
&gt; nonsense_sym = ObjectSpace._id2ref(:a.object_id + 40)
=&gt; :a
&gt; sensible_sym == nonsense_sym
=&gt; false
```

`nonsense_sym` ends up tagged with `RUBY_ID_INSTANCE` instead of
`RB_ID_LOCAL`. That means we can do silly things like:

```
&gt; foo = Object.new
&gt; foo.instance_variable_set(:a, 123)
(irb):2:in `instance_variable_set': `a' is not allowed as an instance variable name (NameError)
&gt; foo.instance_variable_set(ObjectSpace._id2ref(:a.object_id + 40), 123)
=&gt; 123
&gt; foo.instance_variables
=&gt; [:a]
```

This was happening because `get_id_entry` ignores the tag bits when
looking up the symbol. So `rb_id2str(symid)` would return a value and
then we'd continue on with the nonsense `symid`.

This commit prevents the situation by checking that the `symid` actually
matches what we get back from `get_id_entry`. Now we get a `RangeError`
for the nonsense id:

```
&gt; ObjectSpace._id2ref(:a.object_id)
=&gt; :a
&gt; ObjectSpace._id2ref(:a.object_id + 40)
(irb):1:in `_id2ref': 0x000000000013f408 is not symbol id value (RangeError)
```

Co-authored-by: John Hawthorn &lt;jhawthorn@github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #18905] Check symbol name types more strictly</title>
<updated>2022-07-19T15:23:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-07-19T11:24:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8f1759143533d2b772efd5184ba02738f66fe1fc'/>
<id>8f1759143533d2b772efd5184ba02738f66fe1fc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
