<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_super.rb, branch v3_3_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) 6118e8a47394409b53164b60e79fadf348b97db3: [Backport #20716]</title>
<updated>2024-11-04T22:42:47+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-04T22:42:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=edeb0319f7a95dfe3f9b895bcf32371dd8514726'/>
<id>edeb0319f7a95dfe3f9b895bcf32371dd8514726</id>
<content type='text'>
	Fix method caching bug when including/prepend module A that prepends module B

	Fix by always adding the generated iclass to the subclasses list,
	otherwise the method cache for the iclass is not cleared when
	the method in the module is overwritten.

	Fixes [Bug #20716]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix method caching bug when including/prepend module A that prepends module B

	Fix by always adding the generated iclass to the subclasses list,
	otherwise the method cache for the iclass is not cleared when
	the method in the module is overwritten.

	Fixes [Bug #20716]
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 771a2f039b9a059a73e8f111d1d46590fa697f63: [Backport #20213] (#10297)</title>
<updated>2024-03-20T11:05:31+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-03-20T11:05:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=69cee6fee50f63cd52d59325dc3780a6fc4e5ae2'/>
<id>69cee6fee50f63cd52d59325dc3780a6fc4e5ae2</id>
<content type='text'>
Fix incorrect use of VM_CALL_KW_SPLAT_MUT in zsuper with keyword splat

	For zsuper calls with a keyword splat but no actual keywords, the
	keyword splat is passed directly, so it cannot be mutable, because
	if the callee accepts a keyword splat, changes to the keyword splat
	by the callee would be reflected in the caller.

	While here, simplify the logic when the method supports
	literal keywords.  I don't think it is possible for
	a method with has_kw param flags to not have keywords, so add an
	assertion for that, and set VM_CALL_KW_SPLAT_MUT in a single place.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix incorrect use of VM_CALL_KW_SPLAT_MUT in zsuper with keyword splat

	For zsuper calls with a keyword splat but no actual keywords, the
	keyword splat is passed directly, so it cannot be mutable, because
	if the callee accepts a keyword splat, changes to the keyword splat
	by the callee would be reflected in the caller.

	While here, simplify the logic when the method supports
	literal keywords.  I don't think it is possible for
	a method with has_kw param flags to not have keywords, so add an
	assertion for that, and set VM_CALL_KW_SPLAT_MUT in a single place.</pre>
</div>
</content>
</entry>
<entry>
<title>Add tests for cme NULL crash</title>
<updated>2021-11-17T18:20:31+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2021-11-17T14:07:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1454906d4e730312b175197182cf85581821ed5e'/>
<id>1454906d4e730312b175197182cf85581821ed5e</id>
<content type='text'>
Tests for GitHub PR #5122. Originally in GitHub PR #5121.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests for GitHub PR #5122. Originally in GitHub PR #5121.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #18329] Fix crash when calling non-existent super method</title>
<updated>2021-11-11T19:08:38+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2021-11-11T16:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=84202963c52e02cecad3e6b2fad478bfbeee1bc7'/>
<id>84202963c52e02cecad3e6b2fad478bfbeee1bc7</id>
<content type='text'>
The cme is NULL when a method does not exist, so check it before
accessing the callcache.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The cme is NULL when a method does not exist, so check it before
accessing the callcache.
</pre>
</div>
</content>
</entry>
<entry>
<title>This test is not testing attr_writer</title>
<updated>2020-04-15T06:59:29+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-04-15T06:59:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1dad9fa5e1303ce0ba38f55ae81b87ab3857df62'/>
<id>1dad9fa5e1303ce0ba38f55ae81b87ab3857df62</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Invalidate fastpath when calling attr_reader by super</title>
<updated>2020-04-15T06:49:29+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-04-15T06:49:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=79f3403be0cdbec814be29308c0583599ca5824f'/>
<id>79f3403be0cdbec814be29308c0583599ca5824f</id>
<content type='text'>
The same bug as 8355a99883 existed in attr_reader too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The same bug as 8355a99883 existed in attr_reader too.
</pre>
</div>
</content>
</entry>
<entry>
<title>Invalidate fastpath when calling attr_writer by super</title>
<updated>2020-04-15T06:32:13+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2020-04-15T06:24:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8355a998839f17ff214a89062821a0a4287f6a54'/>
<id>8355a998839f17ff214a89062821a0a4287f6a54</id>
<content type='text'>
We started to use fastpath on invokesuper when a method is not refinements
since 5c27681813, but we shouldn't have used fastpath for attr_writer either.

`cc-&gt;aux_.attr_index` is for an actual receiver class, while we store
its superclass in `cc-&gt;klass` and therefore there's no way to properly
invalidate attr_writer's inline cache when it's called by super.

[Bug #16785]

I suspect the same bug also exists in attr_reader. I'll address that in
another commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We started to use fastpath on invokesuper when a method is not refinements
since 5c27681813, but we shouldn't have used fastpath for attr_writer either.

`cc-&gt;aux_.attr_index` is for an actual receiver class, while we store
its superclass in `cc-&gt;klass` and therefore there's no way to properly
invalidate attr_writer's inline cache when it's called by super.

[Bug #16785]

I suspect the same bug also exists in attr_reader. I'll address that in
another commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>should be compared with called_id</title>
<updated>2020-02-12T18:30:22+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-02-12T18:28:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=99a8742067ba262eb324615bfac770d1aea53b07'/>
<id>99a8742067ba262eb324615bfac770d1aea53b07</id>
<content type='text'>
me-&gt;called_id and me-&gt;def-&gt;original_id can be different sometimes
so we should compare with called_id, which is mtbl's key.
(fix GH-PR #2869)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
me-&gt;called_id and me-&gt;def-&gt;original_id can be different sometimes
so we should compare with called_id, which is mtbl's key.
(fix GH-PR #2869)
</pre>
</div>
</content>
</entry>
<entry>
<title>Use inline cache for super calls</title>
<updated>2020-02-12T15:14:55+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2020-01-19T02:18:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ed7b46b66be671165b6f38abd21d7638f4dfdcea'/>
<id>ed7b46b66be671165b6f38abd21d7638f4dfdcea</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make super in instance_eval in method in module raise TypeError</title>
<updated>2019-12-12T06:50:19+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-08-21T20:59:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=55b7ba368696033f2e89b77cbcd4a05dec97b139'/>
<id>55b7ba368696033f2e89b77cbcd4a05dec97b139</id>
<content type='text'>
This makes behavior the same as super in instance_eval in method
in class.  The reason this wasn't implemented before is that
there is a check to determine if the self in the current context
is of the expected class, and a module itself can be included
in multiple classes, so it doesn't have an expected class.

Implementing this requires giving iclasses knowledge of which
class created them, so that super call in the module method
knows the expected class for super calls.  This reference
is called includer, and should only be set for iclasses.

Note that the approach Ruby uses in this check is not robust. If
you instance_eval another object of the same class and call super,
instead of an TypeError, you get super called with the
instance_eval receiver instead of the method receiver.  Truly
fixing super would require keeping a reference to the super object
(method receiver) in each frame where scope has changed, and using
that instead of current self when calling super.

Fixes [Bug #11636]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes behavior the same as super in instance_eval in method
in class.  The reason this wasn't implemented before is that
there is a check to determine if the self in the current context
is of the expected class, and a module itself can be included
in multiple classes, so it doesn't have an expected class.

Implementing this requires giving iclasses knowledge of which
class created them, so that super call in the module method
knows the expected class for super calls.  This reference
is called includer, and should only be set for iclasses.

Note that the approach Ruby uses in this check is not robust. If
you instance_eval another object of the same class and call super,
instead of an TypeError, you get super called with the
instance_eval receiver instead of the method receiver.  Truly
fixing super would require keeping a reference to the super object
(method receiver) in each frame where scope has changed, and using
that instead of current self when calling super.

Fixes [Bug #11636]
</pre>
</div>
</content>
</entry>
</feed>
