Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`class_createInstance()` fills following structure fields properly. ``` struct objc_class { Class isa OBJC_ISA_AVAILABILITY; #if !__OBJC2__ Class super_class OBJC2_UNAVAILABLE; const char *name OBJC2_UNAVAILABLE; long version OBJC2_UNAVAILABLE; long info OBJC2_UNAVAILABLE; long instance_size OBJC2_UNAVAILABLE; struct objc_ivar_list *ivars OBJC2_UNAVAILABLE; struct objc_method_list **methodLists OBJC2_UNAVAILABLE; struct objc_cache *cache OBJC2_UNAVAILABLE; struct objc_protocol_list *protocols OBJC2_UNAVAILABLE; #endif } OBJC2_UNAVAILABLE; ``` Our `klass` in `struct rb_class_ptr` covers `isa` of `struct objc_class`. If store a value in `klass`, it will break `isa`. And then we cannot call Objective-C method on its instance.
- Loading branch information