From 84fd6919445d45cf2a5885016f32b97ead0e23c0 Mon Sep 17 00:00:00 2001 From: theraven Date: Sat, 18 Sep 2010 18:23:49 +0000 Subject: [PATCH] Make adding more than one ivar with class_addIvar() work... --- runtime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime.c b/runtime.c index 43455e1..9cf6036 100644 --- a/runtime.c +++ b/runtime.c @@ -60,9 +60,9 @@ static void objc_updateDtableForClassContainingMethod(Method m) BOOL class_addIvar(Class cls, const char *name, size_t size, uint8_t alignment, const char *types) { - // You can't add ivars to resolved classes (note: You ought to be able to - // add them to classes that currently have no instances) - if (objc_test_class_flag(cls, objc_class_flag_resolved)) + // You can't add ivars to initialized classes. Note: We can't use the + // resolved flag here because class_getInstanceVariable() sets it. + if (objc_test_class_flag(cls, objc_class_flag_initialized)) { return NO; }