OwnedWhenTrackedReceiver,
// Treat this function as returning a non-tracked symbol even if
// the function has been inlined. This is used where the call
- // site summary is more presise than the summary indirectly produced
+ // site summary is more precise than the summary indirectly produced
// by inlining the function
NoRetHard
};
Summ = getFunctionSummary(cast<CXXMemberCall>(Call).getDecl());
break;
case CE_CXXMemberOperator:
- case CE_Block:
+ Summ = getFunctionSummary(cast<CXXMemberOperatorCall>(Call).getDecl());
+ break;
case CE_CXXConstructor:
+ Summ = getFunctionSummary(cast<CXXConstructorCall>(Call).getDecl());
+ break;
+ case CE_Block:
case CE_CXXDestructor:
case CE_CXXAllocator:
// FIXME: These calls are currently unsupported.
struct OtherStruct {
static void doNothingToArray(OSArray *array);
+ OtherStruct(OSArray *arr);
};
struct OSMetaClassBase {
} // expected-warning{{Potential leak of an object stored into 'arr'}}
// expected-note@-1{{Object leaked}}
+void check_no_invalidation_other_struct() {
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to function 'withCapacity' returns an OSObject of type struct OSArray * with a +1 retain count}}
+ OtherStruct other(arr); // expected-warning{{Potential leak}}
+ // expected-note@-1{{Object leaked}}
+}
+
void check_rc_consumed() {
OSArray *arr = OSArray::withCapacity(10);
OSArray::consumeArray(arr);