Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inifinite loop in some while-loops #331

Merged
merged 1 commit into from
Mar 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ - (NSArray *)autoInjectedPropertiesForClass:(Class)clazz
NSMutableArray *injections = nil;
NSSet *allProperties = [TyphoonIntrospectionUtils injectedPropertiesForClass:clazz upToParentClass:[NSObject class]];
for (NSString *propertyName in allProperties) {
TyphoonTypeDescriptor *type = [clazz typhoon_typeForPropertyWithName:propertyName];
TyphoonTypeDescriptor *type = [TyphoonIntrospectionUtils typeForPropertyWithName:propertyName inClass:clazz];

id explicitType = TypeForInjectionFromType(type);
if (!explicitType) {
[NSException raise:NSInternalInconsistencyException format:@"Can't resolve '%@' property in %@ class. Make sure that specified protocol/class exist and linked.", propertyName, clazz];
Expand Down
6 changes: 3 additions & 3 deletions Source/Utils/TyphoonIntrospectionUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ + (NSSet *)injectedPropertiesForClass:(Class)clazz upToParentClass:(Class)parent
NSString *injectedObjectClassName = NSStringFromClass([TyphoonInjectedObject class]);
NSString *injectedProtolName = NSStringFromProtocol(@protocol(TyphoonInjectedProtocol));

while (clazz != parent) {
while (clazz && clazz != parent) {
unsigned int count = 0;
objc_property_t *properties = class_copyPropertyList(clazz, &count);

Expand Down Expand Up @@ -177,7 +177,7 @@ + (NSSet *)propertiesForClass:(Class)clazz upToParentClass:(Class)parent

NSMutableSet *propertyNames = [[NSMutableSet alloc] init];

while (clazz != parent) {
while (clazz && clazz != parent) {
unsigned int count = 0;
objc_property_t *properties = class_copyPropertyList(clazz, &count);

Expand All @@ -202,7 +202,7 @@ + (NSSet *)methodsForClass:(Class)clazz upToParentClass:(Class)parent
{
NSMutableSet *methodSelectors = [[NSMutableSet alloc] init];

while (clazz != parent) {
while (clazz && clazz != parent) {
unsigned int methodCount;
Method *methodList = class_copyMethodList(clazz, &methodCount);
for (unsigned int i = 0; i < methodCount; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4CE1A36BA53008D8162"
BuildableName = "TyphoonFrameworkSwiftExampleTests.xctest"
BlueprintName = "TyphoonFrameworkSwiftExampleTests"
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand All @@ -28,6 +42,16 @@
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4CE1A36BA53008D8162"
BuildableName = "TyphoonFrameworkSwiftExampleTests.xctest"
BlueprintName = "TyphoonFrameworkSwiftExampleTests"
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
Expand All @@ -48,7 +72,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4BA1A36BA53008D8162"
Expand All @@ -66,7 +91,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4BA1A36BA53008D8162"
Expand Down
87 changes: 83 additions & 4 deletions Typhoon.xcodeproj/xcshareddata/xcschemes/TyphoonSwift.xcscheme
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction>
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForRunning = "YES">
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4BA1A36BA53008D8162"
Expand All @@ -13,12 +19,60 @@
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4CE1A36BA53008D8162"
BuildableName = "TyphoonFrameworkSwiftExampleTests.xctest"
BlueprintName = "TyphoonFrameworkSwiftExampleTests"
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4CE1A36BA53008D8162"
BuildableName = "TyphoonFrameworkSwiftExampleTests.xctest"
BlueprintName = "TyphoonFrameworkSwiftExampleTests"
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4BA1A36BA53008D8162"
BuildableName = "TyphoonFrameworkSwiftExample.app"
BlueprintName = "TyphoonFrameworkSwiftExample"
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug">
<BuildableProductRunnable>
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4BA1A36BA53008D8162"
Expand All @@ -27,5 +81,30 @@
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "90ABC4BA1A36BA53008D8162"
BuildableName = "TyphoonFrameworkSwiftExample.app"
BlueprintName = "TyphoonFrameworkSwiftExample"
ReferencedContainer = "container:Typhoon.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>