ruby/ext
eileencodes 8a3d57971c Fix cvar caching when class is cloned
The class variable cache that was added in
https://github.com/ruby/ruby/pull/4544 changed the behavior of class
variables on cloned classes. As reported when a class is cloned AND a
class variable was set, and the class variable was read from the
original class, reading a class variable from the cloned class would
return the value from the original class.

This was happening because the IC (inline cache) is stored on the ISEQ
which is shared between the original and cloned class, therefore they
share the cache too.

To fix this we are now storing the `cref` in the cache so that we can
check if it's equal to the current `cref`. If it's different we don't
want to read from the cache. If it's the same we do. Cloned classes
don't share the same cref with their original class.

This will need to be backported to 3.1 in addition to 3.2 since the bug
exists in both versions.

We also added a marking function which was missing.

Fixes [Bug #19379]

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-07-01 14:17:30 +09:00
..
-test- Use rb_sprintf instead of deprecated sprintf 2022-11-25 08:51:14 +09:00
bigdecimal [ruby/bigdecimal] Bump version to 3.1.3 2022-12-05 10:44:30 +00:00
cgi/escape [ruby/cgi] Implement CGI.url_encode and CGI.url_decode 2022-08-16 19:12:03 +09:00
continuation [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
coverage Update dependencies 2022-12-06 12:37:23 -08:00
date [ruby/date] Bump version to 3.3.3 2022-12-19 10:50:21 +09:00
digest [ruby/digest] Bump version to 3.1.1 2022-12-05 05:56:58 +00:00
erb/escape [ruby/erb] Skip using the extension for truffleruby as well 2022-11-27 06:30:48 +00:00
etc [ruby/etc] Bump version to 1.4.2 2022-12-09 05:57:49 +00:00
fcntl [ruby/fcntl] Bump version to 1.0.2 2022-12-05 06:09:41 +00:00
fiddle Merge fiddle-1.1.1 2022-12-09 16:36:22 +09:00
io [ruby/io-console] Bump version to 0.6.0 2022-12-16 03:45:11 +00:00
json Merge json-2.6.3 2022-12-09 16:36:22 +09:00
monitor [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
nkf [ruby/nkf] Bump version to 0.1.2 2022-12-05 06:51:37 +00:00
objspace Fix cvar caching when class is cloned 2023-07-01 14:17:30 +09:00
openssl Revert the additional change from openssl-3.1.0 2022-12-23 19:37:24 +09:00
pathname [ruby/pathname] Bump version to 0.2.1 2022-12-05 16:33:43 +09:00
psych [ruby/psych] Bump version to 5.0.1 2022-12-08 02:08:25 +00:00
pty Transition shape when object's capacity changes 2022-11-10 10:11:34 -05:00
racc/cparse Bump version to 1.6.2 2022-12-23 09:51:52 +09:00
rbconfig/sizeof [Feature #18249] Update dependencies 2022-02-22 09:55:21 -05:00
readline [ruby/readline-ext] Bump version to 0.1.5 2022-12-14 05:54:06 +00:00
ripper merge revision(s) fad48fefe1: [Backport #19399] 2023-02-07 13:46:36 +09:00
rubyvm Added depend files 2019-07-14 01:31:29 +09:00
socket Remove require 'io/wait' where it's no longer necessary. (#6932) 2022-12-15 11:37:01 +13:00
stringio merge revision(s) 21dced8b01: [Backport #19389] 2023-01-31 11:08:50 +09:00
strscan Merge strscan-3.0.5 2022-12-09 16:36:22 +09:00
syslog [ruby/syslog] Bump version to 0.1.1 2022-12-14 06:18:10 +00:00
win32 Expand tabs [ci skip] 2022-07-21 09:42:04 -07:00
win32ole [ruby/win32ole] Bump version to 1.8.9 2022-12-05 08:22:51 +00:00
zlib [ruby/zlib] Bump version to 3.0.0 2022-12-05 08:26:21 +00:00
.document Remove unnecessary files from .document 2020-12-20 16:00:13 +09:00
extmk.rb Use class methods of File over Kernel.open and IO.read 2022-11-21 22:16:49 +09:00
Setup Removed sdbm entries from toolchanins 2020-06-19 08:26:47 +09:00
Setup.atheos Removed sdbm entries from toolchanins 2020-06-19 08:26:47 +09:00
Setup.nt Removed sdbm entries from toolchanins 2020-06-19 08:26:47 +09:00