Remove opts from default build - they must now be explicitly built.

Don't crash if objc_disposeClassPair() is called on a class that is not get
registered with the runtime.
This commit is contained in:
theraven 2011-05-04 12:53:04 +00:00
parent be68d81286
commit d12de81cd6
2 changed files with 13 additions and 5 deletions

View File

@ -120,14 +120,14 @@ endif
include $(GNUSTEP_MAKEFILES)/aggregate.make
include $(GNUSTEP_MAKEFILES)/library.make
all::
build-opts:
@echo Building LLVM optimisation passes...
@sh build_opts.sh $(MAKE) all
install::
install-opts: build_opts
@echo Installing LLVM optimisation passes...
@sh build_opts.sh $(MAKE) install
clean::
clean-opts:
@echo Cleaning LLVM optimisation passes...
@sh build_opts.sh $(MAKE) clean

View File

@ -534,6 +534,8 @@ static void freeIvarLists(Class aClass)
*/
static inline void safe_remove_from_subclass_list(Class cls)
{
// If this class hasn't been added to the class hierarchy, then this is easy
if (!objc_test_class_flag(cls, objc_class_flag_resolved)) { return; }
Class sub = cls->super_class->subclass_list;
if (sub == cls)
{
@ -569,8 +571,14 @@ void objc_disposeClassPair(Class cls)
freeMethodLists(cls);
freeMethodLists(meta);
freeIvarLists(cls);
free_dtable(cls->dtable);
free_dtable(meta->dtable);
if (cls->dtable != uninstalled_dtable)
{
free_dtable(cls->dtable);
}
if (meta->dtable != uninstalled_dtable)
{
free_dtable(meta->dtable);
}
// Free the class and metaclass
free(meta);