Created
April 12, 2016 00:51
-
-
Save tenderlove/3455cf23961ecf1e5213359a59e4c40e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/class.c b/class.c | |
index 0261838..65428be 100644 | |
--- a/class.c | |
+++ b/class.c | |
@@ -1591,7 +1591,9 @@ singleton_class_of(VALUE obj) | |
klass = RBASIC(obj)->klass; | |
if (!(FL_TEST(klass, FL_SINGLETON) && | |
rb_ivar_get(klass, id_attached) == obj)) { | |
+ rb_serial_t serial = RCLASS_SERIAL(klass); | |
klass = rb_make_metaclass(obj, klass); | |
+ RCLASS_SERIAL(klass) = serial; | |
} | |
if (OBJ_TAINTED(obj)) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment