Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make class and module objects unfreezeable to prevent future extensio…

…n of these objects from resulting in TypeErrors.
  • Loading branch information...
commit a9e712b1b495f5d19b98ef23940c6be20c6f8581 1 parent 415e5dc
Brandon Mitchell authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  object.c
View
2  object.c
@@ -252,7 +252,7 @@ rb_obj_freeze(VALUE obj)
break;
}
}
- if (!OBJ_FROZEN(obj)) {
+ if (!OBJ_FROZEN(obj) && TYPE(obj) != T_CLASS && TYPE(obj) != T_MODULE) {
if (rb_safe_level() >= 4 && !OBJ_TAINTED(obj)) {
rb_raise(rb_eSecurityError, "Insecure: can't freeze object");
}
Please sign in to comment.
Something went wrong with that request. Please try again.