Skip to content

Commit 6e9a341

Browse files
Satoshi Tagomoritagomoris
authored andcommitted
zeroing on the table to suppress unintentional call of classext_foreach
1 parent 88d7ef4 commit 6e9a341

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

class.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,10 @@ class_alloc0(enum ruby_value_type type, VALUE klass, bool namespaceable)
693693
RCLASS_SET_SUPER((VALUE)obj, 0);
694694
*/
695695

696+
if (namespaceable) {
697+
((struct RClass_namespaceable *)obj)->ns_classext_tbl = NULL;
698+
}
699+
696700
RCLASS_PRIME_NS((VALUE)obj) = ns;
697701
// Classes/Modules defined in user namespaces are
698702
// writable directly because it exists only in a namespace.

0 commit comments

Comments
 (0)