diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-19 15:30:53 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-19 15:30:53 +0100 |
commit | 98a2664219df9f0bc7f8fdfb14dcc2e8972782ba (patch) | |
tree | 17d02e00927e2f7987af19a86218976293736af9 | |
parent | 50785250d73abef4b10f6435249de64a924af7ef (diff) |
Avoid sending messages to potentially unregistered classes.
darcs-hash:e57bfdafd5e8690f8e875bf6a5a0a10050b77303
-rw-r--r-- | Lisp/method-invocation.lisp | 2 | ||||
-rw-r--r-- | Objective-C/libobjcl.m | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Lisp/method-invocation.lisp b/Lisp/method-invocation.lisp index 8c94ecc..d1412bf 100644 --- a/Lisp/method-invocation.lisp +++ b/Lisp/method-invocation.lisp @@ -322,6 +322,8 @@ easier to use with __apply__. (defun low-level-invoke (receiver selector superclass-pointer-for-send-super return-typestring return-type arg-typestrings arg-types argc args) + (when (object-is-class-p receiver) + (foreign-class-ensure-registered receiver)) (let ((return-c-type (typespec->c-type return-type)) (arg-c-types (mapcar #'typespec->c-type arg-types))) (with-foreign-string-pool (register-temporary-string diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m index 646dccd..8489891 100644 --- a/Objective-C/libobjcl.m +++ b/Objective-C/libobjcl.m @@ -382,7 +382,7 @@ objcl_object_is_class (id obj) { TRACE (@"is-class %p", obj); #ifdef __NEXT_RUNTIME__ - return [obj class] == obj; + return class_isMetaClass (object_getClass (obj)); #else /* return CLS_ISCLASS (obj); */ return object_is_class (obj); @@ -845,7 +845,6 @@ void objcl_finalise_class (Class class) { #ifdef __NEXT_RUNTIME__ - /* FIXME: Should we do this if class is a metaclass? */ if (!objcl_object_is_meta_class (class)) objc_registerClassPair (class); #else |