From 82157634ca0ca5b6a4a67a194dd11f15d9b72835 Mon Sep 17 00:00:00 2001 From: John Engelhart Date: Thu, 12 Jul 2012 10:32:07 -0700 Subject: [PATCH] Add a `#ifdef` to silence a `clang` static analyzer false positive warning. The current (at the time of this writing) version of the `clang` static analyzer is complaing that the `objects` pointer is `NULL`. This is a false positive warning from the analyzer. --- JSONKit.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/JSONKit.m b/JSONKit.m index 520b4be..0e9331f 100644 --- a/JSONKit.m +++ b/JSONKit.m @@ -744,7 +744,9 @@ - (void)getObjects:(id *)objectsPtr range:(NSRange)range NSParameterAssert((objects != NULL) && (count <= capacity)); if((objectsPtr == NULL) && (NSMaxRange(range) > 0UL)) { [NSException raise:NSRangeException format:@"*** -[%@ %@]: pointer to objects array is NULL but range length is %lu", NSStringFromClass([self class]), NSStringFromSelector(_cmd), (unsigned long)NSMaxRange(range)]; } if((range.location > count) || (NSMaxRange(range) > count)) { [NSException raise:NSRangeException format:@"*** -[%@ %@]: index (%lu) beyond bounds (%lu)", NSStringFromClass([self class]), NSStringFromSelector(_cmd), (unsigned long)NSMaxRange(range), (unsigned long)count]; } +#ifndef __clang_analyzer__ memcpy(objectsPtr, objects + range.location, range.length * sizeof(id)); +#endif } - (id)objectAtIndex:(NSUInteger)objectIndex