Skip to content

Commit

Permalink
Fix three static analyzer warnings.
Browse files Browse the repository at this point in the history
Remove canBeCombined, and just check the combined pointer instead.
  • Loading branch information
nygard committed Sep 30, 2013
1 parent f467159 commit 006477b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/CDStructureTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ - (void)runPhase2AtDepth:(NSUInteger)depth;
// If not, this means that either the types or the member names conflicted, and we save the entire group as an exception.
for (NSString *key in [nameDict allKeys]) {
CDStructureInfo *combined = nil;
BOOL canBeCombined = YES;

//NSLog(@"key... %@", key);
NSMutableArray *group = nameDict[key];
Expand All @@ -306,13 +305,13 @@ - (void)runPhase2AtDepth:(NSUInteger)depth;
combined.isUsedInMethod = YES;
#endif
} else {
canBeCombined = NO;
combined = nil;
break;
}
}
}

if (canBeCombined) {
if (combined != nil) {
CDStructureInfo *previousInfo = _phase2_namedStructureInfo[key];
if (previousInfo != nil) {
// struct _Vector_impl in HALLab.
Expand Down Expand Up @@ -341,7 +340,6 @@ - (void)runPhase2AtDepth:(NSUInteger)depth;
//NSLog(@"======================================================================");
for (NSString *key in [anonDict allKeys]) {
CDStructureInfo *combined = nil;
BOOL canBeCombined = YES;

//NSLog(@"key... %@", key);
NSMutableArray *group = anonDict[key];
Expand All @@ -365,13 +363,13 @@ - (void)runPhase2AtDepth:(NSUInteger)depth;
NSLog(@"previous: %@", combined.type.typeString);
NSLog(@" This: %@", info.type.typeString);
}
canBeCombined = NO;
combined = nil;
break;
}
}
}

if (canBeCombined) {
if (combined != nil) {
if (_phase2_anonStructureInfo[key] != nil) {
// This shouldn't happen, but the named case might.
NSLog(@"[%@] %s, WARNING: depth %lu type %@ has conflict(?) at lower level", self.identifier, __cmd, depth, key);
Expand Down

0 comments on commit 006477b

Please sign in to comment.