mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
Fix wrong way to check an object is an instance of rb_cNamespace
This commit is contained in:
parent
545cee083b
commit
2100826243
@ -40,7 +40,7 @@ struct rb_namespace_struct {
|
||||
};
|
||||
typedef struct rb_namespace_struct rb_namespace_t;
|
||||
|
||||
#define NAMESPACE_OBJ_P(obj) (CLASS_OF(obj) == rb_cNamespace)
|
||||
#define NAMESPACE_OBJ_P(obj) (rb_obj_class(obj) == rb_cNamespace)
|
||||
|
||||
#define NAMESPACE_ROOT_P(ns) (ns && !ns->is_user)
|
||||
#define NAMESPACE_USER_P(ns) (ns && ns->is_user)
|
||||
|
||||
@ -877,7 +877,8 @@ rb_initialize_main_namespace(void)
|
||||
namespace_experimental_warned = 1;
|
||||
}
|
||||
|
||||
main_ns = rb_class_new_instance_pass_kw(0, NULL, rb_cNamespace);
|
||||
main_ns = rb_class_new_instance(0, NULL, rb_cNamespace);
|
||||
VM_ASSERT(NAMESPACE_OBJ_P(main_ns));
|
||||
ns = rb_get_namespace_t(main_ns);
|
||||
ns->ns_object = main_ns;
|
||||
ns->ns_id = namespace_generate_id();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user