Index: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
+++ clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
@@ -186,14 +186,14 @@
}
if (CurrV.getObjKind() == ObjKind::CF) {
- os << " a Core Foundation object of type "
- << Sym->getType().getAsString() << " with a ";
+ os << " a Core Foundation object of type '"
+ << Sym->getType().getAsString() << "' with a ";
} else if (CurrV.getObjKind() == ObjKind::OS) {
- os << " an OSObject of type " << getPrettyTypeName(Sym->getType())
- << " with a ";
+ os << " an OSObject of type '" << getPrettyTypeName(Sym->getType())
+ << "' with a ";
} else if (CurrV.getObjKind() == ObjKind::Generalized) {
- os << " an object of type " << Sym->getType().getAsString()
- << " with a ";
+ os << " an object of type '" << Sym->getType().getAsString()
+ << "' with a ";
} else {
assert(CurrV.getObjKind() == ObjKind::ObjC);
QualType T = Sym->getType();
@@ -624,7 +624,8 @@
if (RegionDescription) {
os << "object allocated and stored into '" << *RegionDescription << '\'';
} else {
- os << "allocated object of type " << getPrettyTypeName(Sym->getType());
+ os << "allocated object of type '" << getPrettyTypeName(Sym->getType())
+ << "'";
}
// Get the retain count.
@@ -761,7 +762,7 @@
} else {
// If we can't figure out the name, just supply the type information.
- os << " of type " << getPrettyTypeName(Sym->getType());
+ os << " of type '" << getPrettyTypeName(Sym->getType()) << "'";
}
}
Index: clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
===================================================================
--- clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
+++ clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
@@ -1933,9 +1933,9 @@
depth0
extended_message
- Call to function 'CFNumberCreate' returns a Core Foundation object of type CFNumberRef with a +1 retain count
+ Call to function 'CFNumberCreate' returns a Core Foundation object of type 'CFNumberRef' with a +1 retain count
message
- Call to function 'CFNumberCreate' returns a Core Foundation object of type CFNumberRef with a +1 retain count
+ Call to function 'CFNumberCreate' returns a Core Foundation object of type 'CFNumberRef' with a +1 retain count
kindcontrol
Index: clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
===================================================================
--- clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
+++ clang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
@@ -223,9 +223,9 @@
depth0
extended_message
- Call to function 'CFDateCreate' returns a Core Foundation object of type CFDateRef with a +1 retain count
+ Call to function 'CFDateCreate' returns a Core Foundation object of type 'CFDateRef' with a +1 retain count
message
- Call to function 'CFDateCreate' returns a Core Foundation object of type CFDateRef with a +1 retain count
+ Call to function 'CFDateCreate' returns a Core Foundation object of type 'CFDateRef' with a +1 retain count
kindcontrol
@@ -739,9 +739,9 @@
depth0
extended_message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
kindcontrol
@@ -934,9 +934,9 @@
depth0
extended_message
- Call to function 'CFCreateString' returns a Core Foundation object of type CFStringRef with a +1 retain count
+ Call to function 'CFCreateString' returns a Core Foundation object of type 'CFStringRef' with a +1 retain count
message
- Call to function 'CFCreateString' returns a Core Foundation object of type CFStringRef with a +1 retain count
+ Call to function 'CFCreateString' returns a Core Foundation object of type 'CFStringRef' with a +1 retain count
kindcontrol
@@ -1353,9 +1353,9 @@
depth0
extended_message
- Call to function 'CFDateCreate' returns a Core Foundation object of type CFDateRef with a +1 retain count
+ Call to function 'CFDateCreate' returns a Core Foundation object of type 'CFDateRef' with a +1 retain count
message
- Call to function 'CFDateCreate' returns a Core Foundation object of type CFDateRef with a +1 retain count
+ Call to function 'CFDateCreate' returns a Core Foundation object of type 'CFDateRef' with a +1 retain count
kindcontrol
@@ -1679,9 +1679,9 @@
depth0
extended_message
- Call to function 'CFCreateString' returns a Core Foundation object of type CFStringRef with a +1 retain count
+ Call to function 'CFCreateString' returns a Core Foundation object of type 'CFStringRef' with a +1 retain count
message
- Call to function 'CFCreateString' returns a Core Foundation object of type CFStringRef with a +1 retain count
+ Call to function 'CFCreateString' returns a Core Foundation object of type 'CFStringRef' with a +1 retain count
kindcontrol
@@ -1727,12 +1727,12 @@
depth0
extended_message
- Object leaked: allocated object of type CFStringRef is not referenced later in this execution path and has a retain count of +1
+ Object leaked: allocated object of type 'CFStringRef' is not referenced later in this execution path and has a retain count of +1
message
- Object leaked: allocated object of type CFStringRef is not referenced later in this execution path and has a retain count of +1
+ Object leaked: allocated object of type 'CFStringRef' is not referenced later in this execution path and has a retain count of +1
- descriptionPotential leak of an object of type CFStringRef
+ descriptionPotential leak of an object of type 'CFStringRef'
categoryMemory (Core Foundation/Objective-C)
typeLeak
check_nameosx.cocoa.RetainCount
Index: clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
===================================================================
--- clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
+++ clang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
@@ -1,1275 +1,1309 @@
-diagnostics
-
-
- path
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line48
- col3
- file0
-
-
- line48
- col15
- file0
-
-
- end
-
-
- line49
- col3
- file0
-
-
- line49
- col6
- file0
-
-
-
-
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line49
- col3
- file0
-
-
- line49
- col6
- file0
-
-
- end
-
-
- line49
- col26
- file0
-
-
- line49
- col38
- file0
-
-
-
-
-
-
- kindevent
- location
+
+
+
+
+ clang_version
+clang version 8.0.0
+ diagnostics
+
+
+ path
+
- line49
- col26
- file0
-
- ranges
-
+ kindcontrol
+ edges
- line49
- col26
- file0
+ start
+
+
+ line49
+ col3
+ file0
+
+
+ line49
+ col15
+ file0
+
+
+ end
+
+
+ line50
+ col3
+ file0
+
+
+ line50
+ col6
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line53
- col4
- file0
+ start
+
+
+ line50
+ col3
+ file0
+
+
+ line50
+ col6
+ file0
+
+
+ end
+
+
+ line50
+ col26
+ file0
+
+
+ line50
+ col38
+ file0
+
+
-
- depth0
- extended_message
- Calling 'performAction'
- message
- Calling 'performAction'
-
-
- kindevent
- location
-
- line27
- col1
- file0
- depth1
- extended_message
- Entered call from 'runTest'
- message
- Entered call from 'runTest'
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line27
- col1
- file0
-
-
- line27
- col6
- file0
-
-
- end
-
-
- line28
- col3
- file0
-
-
- line28
- col15
- file0
-
-
-
-
-
-
- kindcontrol
- edges
+
+ kindevent
+ location
+
+ line50
+ col26
+ file0
+
+ ranges
-
- start
-
-
- line28
- col3
- file0
-
-
- line28
- col15
- file0
-
-
- end
-
-
- line29
- col3
- file0
-
-
- line29
- col21
- file0
-
-
-
+
+
+ line50
+ col26
+ file0
+
+
+ line54
+ col4
+ file0
+
+
-
-
- kindevent
- location
+ depth0
+ extended_message
+ Calling 'performAction'
+ message
+ Calling 'performAction'
+
- line29
- col3
- file0
+ kindevent
+ location
+
+ line28
+ col1
+ file0
+
+ depth1
+ extended_message
+ Entered call from 'runTest'
+ message
+ Entered call from 'runTest'
- ranges
-
+
+ kindcontrol
+ edges
- line29
- col3
- file0
+ start
+
+
+ line28
+ col1
+ file0
+
+
+ line28
+ col6
+ file0
+
+
+ end
+
+
+ line29
+ col3
+ file0
+
+
+ line29
+ col15
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line43
- col4
- file0
+ start
+
+
+ line29
+ col3
+ file0
+
+
+ line29
+ col15
+ file0
+
+
+ end
+
+
+ line30
+ col3
+ file0
+
+
+ line30
+ col21
+ file0
+
+
-
- depth1
- extended_message
- Calling 'reallyPerformAction'
- message
- Calling 'reallyPerformAction'
-
-
- kindevent
- location
-
- line22
- col1
- file0
- depth2
- extended_message
- Entered call from 'performAction'
- message
- Entered call from 'performAction'
-
-
- kindcontrol
- edges
+
+ kindevent
+ location
+
+ line30
+ col3
+ file0
+
+ ranges
-
- start
-
-
- line22
- col1
- file0
-
-
- line22
- col6
- file0
-
-
- end
-
-
- line23
- col3
- file0
-
-
- line23
- col16
- file0
-
-
-
+
+
+ line30
+ col3
+ file0
+
+
+ line44
+ col4
+ file0
+
+
-
-
- kindevent
- location
+ depth1
+ extended_message
+ Calling 'reallyPerformAction'
+ message
+ Calling 'reallyPerformAction'
+
- line23
- col3
- file0
+ kindevent
+ location
+
+ line23
+ col1
+ file0
+
+ depth2
+ extended_message
+ Entered call from 'performAction'
+ message
+ Entered call from 'performAction'
- ranges
-
+
+ kindcontrol
+ edges
- line23
- col3
- file0
-
-
- line23
- col58
- file0
+ start
+
+
+ line23
+ col1
+ file0
+
+
+ line23
+ col6
+ file0
+
+
+ end
+
+
+ line24
+ col3
+ file0
+
+
+ line24
+ col16
+ file0
+
+
-
- depth2
- extended_message
- Calling anonymous block
- message
- Calling anonymous block
-
-
- kindevent
- location
-
- line29
- col23
- file0
- depth3
- extended_message
- Entered call from 'reallyPerformAction'
- message
- Entered call from 'reallyPerformAction'
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line29
- col23
- file0
-
-
- line29
- col23
- file0
-
-
- end
-
-
- line31
- col5
- file0
-
-
- line31
- col6
- file0
-
-
-
-
-
-
- kindcontrol
- edges
+
+ kindevent
+ location
+
+ line24
+ col3
+ file0
+
+ ranges
-
- start
-
-
- line31
- col5
- file0
-
-
- line31
- col6
- file0
-
-
- end
-
-
- line31
- col9
- file0
-
-
- line31
- col12
- file0
-
-
-
+
+
+ line24
+ col3
+ file0
+
+
+ line24
+ col58
+ file0
+
+
-
-
- kindevent
- location
+ depth2
+ extended_message
+ Calling anonymous block
+ message
+ Calling anonymous block
+
- line31
- col9
- file0
+ kindevent
+ location
+
+ line30
+ col23
+ file0
+
+ depth3
+ extended_message
+ Entered call from 'reallyPerformAction'
+ message
+ Entered call from 'reallyPerformAction'
- ranges
-
+
+ kindcontrol
+ edges
- line31
- col9
- file0
+ start
+
+
+ line30
+ col23
+ file0
+
+
+ line30
+ col23
+ file0
+
+
+ end
+
+
+ line32
+ col5
+ file0
+
+
+ line32
+ col6
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line31
- col12
- file0
+ start
+
+
+ line32
+ col5
+ file0
+
+
+ line32
+ col6
+ file0
+
+
+ end
+
+
+ line32
+ col9
+ file0
+
+
+ line32
+ col12
+ file0
+
+
-
- depth3
- extended_message
- Assuming 'cond' is not equal to 0
- message
- Assuming 'cond' is not equal to 0
-
-
- kindcontrol
- edges
+
+
+ kindevent
+ location
+
+ line32
+ col9
+ file0
+
+ ranges
-
- start
-
-
- line31
- col9
- file0
-
-
- line31
- col12
- file0
-
-
- end
-
-
- line33
- col7
- file0
-
-
- line33
- col14
- file0
-
-
-
+
+
+ line32
+ col9
+ file0
+
+
+ line32
+ col12
+ file0
+
+
-
-
- kindevent
- location
-
- line33
- col30
- file0
+ depth3
+ extended_message
+ Assuming 'cond' is not equal to 0
+ message
+ Assuming 'cond' is not equal to 0
- ranges
-
+
+ kindcontrol
+ edges
- line33
- col30
- file0
-
-
- line33
- col50
- file0
+ start
+
+
+ line32
+ col9
+ file0
+
+
+ line32
+ col12
+ file0
+
+
+ end
+
+
+ line34
+ col7
+ file0
+
+
+ line34
+ col14
+ file0
+
+
-
- depth3
- extended_message
- NSNumber boxed expression produces an object with a +0 retain count
- message
- NSNumber boxed expression produces an object with a +0 retain count
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line33
- col7
- file0
-
-
- line33
- col14
- file0
-
-
- end
-
-
- line35
- col7
- file0
-
-
- line35
- col14
- file0
-
-
-
-
-
-
- kindcontrol
- edges
+
+
+ kindevent
+ location
+
+ line34
+ col30
+ file0
+
+ ranges
-
- start
-
-
- line35
- col7
- file0
-
-
- line35
- col14
- file0
-
-
- end
-
-
- line35
- col33
- file0
-
-
- line35
- col38
- file0
-
-
-
+
+
+ line34
+ col30
+ file0
+
+
+ line34
+ col50
+ file0
+
+
-
-
- kindevent
- location
-
- line35
- col33
- file0
+ depth3
+ extended_message
+ NSNumber boxed expression produces an object with a +0 retain count
+ message
+ NSNumber boxed expression produces an object with a +0 retain count
- ranges
-
+
+ kindcontrol
+ edges
- line35
- col33
- file0
+ start
+
+
+ line34
+ col7
+ file0
+
+
+ line34
+ col14
+ file0
+
+
+ end
+
+
+ line36
+ col7
+ file0
+
+
+ line36
+ col14
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line35
- col50
- file0
+ start
+
+
+ line36
+ col7
+ file0
+
+
+ line36
+ col14
+ file0
+
+
+ end
+
+
+ line36
+ col33
+ file0
+
+
+ line36
+ col38
+ file0
+
+
-
- depth3
- extended_message
- Calling anonymous block
- message
- Calling anonymous block
-
-
- kindevent
- location
-
- line49
- col40
- file0
- depth4
- extended_message
- Entered call
- message
- Entered call
-
-
- kindcontrol
- edges
+
+ kindevent
+ location
+
+ line36
+ col33
+ file0
+
+ ranges
-
- start
-
-
- line49
- col40
- file0
-
-
- line49
- col40
- file0
-
-
- end
-
-
- line50
- col5
- file0
-
-
- line50
- col17
- file0
-
-
-
+
+
+ line36
+ col33
+ file0
+
+
+ line36
+ col50
+ file0
+
+
-
-
- kindevent
- location
+ depth3
+ extended_message
+ Calling anonymous block
+ message
+ Calling anonymous block
+
- line50
- col21
- file0
+ kindevent
+ location
+
+ line50
+ col40
+ file0
+
+ depth4
+ extended_message
+ Entered call
+ message
+ Entered call
- ranges
-
+
+ kindcontrol
+ edges
- line50
- col21
- file0
-
-
- line50
- col39
- file0
+ start
+
+
+ line50
+ col40
+ file0
+
+
+ line50
+ col40
+ file0
+
+
+ end
+
+
+ line51
+ col5
+ file0
+
+
+ line51
+ col17
+ file0
+
+
+
+
+ kindevent
+ location
+
+ line51
+ col21
+ file0
+
+ ranges
+
+
+
+ line51
+ col21
+ file0
+
+
+ line51
+ col39
+ file0
+
+
+
+
+ line51
+ col22
+ file0
+
+
+ line51
+ col31
+ file0
+
+
+
+ depth4
+ extended_message
+ Reference count incremented. The object now has a +1 retain count
+ message
+ Reference count incremented. The object now has a +1 retain count
+
+
+ kindcontrol
+ edges
- line50
- col22
- file0
-
-
- line50
- col31
- file0
+ start
+
+
+ line51
+ col5
+ file0
+
+
+ line51
+ col17
+ file0
+
+
+ end
+
+
+ line53
+ col5
+ file0
+
+
+ line53
+ col10
+ file0
+
+
-
- depth4
- extended_message
- Reference count incremented. The object now has a +1 retain count
- message
- Reference count incremented. The object now has a +1 retain count
-
-
- kindcontrol
- edges
+
+
+ kindevent
+ location
+
+ line36
+ col33
+ file0
+
+ ranges
-
- start
-
-
- line50
- col5
- file0
-
-
- line50
- col17
- file0
-
-
- end
-
-
- line52
- col5
- file0
-
-
- line52
- col10
- file0
-
-
-
+
+
+ line36
+ col33
+ file0
+
+
+ line36
+ col50
+ file0
+
+
-
-
- kindevent
- location
-
- line35
- col33
- file0
+ depth3
+ extended_message
+ Returning to caller
+ message
+ Returning to caller
- ranges
-
+
+ kindcontrol
+ edges
- line35
- col33
- file0
-
-
- line35
- col50
- file0
+ start
+
+
+ line36
+ col33
+ file0
+
+
+ line36
+ col38
+ file0
+
+
+ end
+
+
+ line36
+ col7
+ file0
+
+
+ line36
+ col14
+ file0
+
+
-
- depth3
- extended_message
- Returning to caller
- message
- Returning to caller
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line35
- col33
- file0
-
-
- line35
- col38
- file0
-
-
- end
-
-
- line35
- col7
- file0
-
-
- line35
- col14
- file0
-
-
-
-
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line35
- col7
- file0
-
-
- line35
- col14
- file0
-
-
- end
-
-
- line37
- col7
- file0
-
-
- line37
- col8
- file0
-
-
-
-
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line37
- col7
- file0
-
-
- line37
- col8
- file0
-
-
- end
-
-
- line40
- col7
- file0
-
-
- line40
- col18
- file0
-
-
-
-
-
-
- kindevent
- location
-
- line23
- col3
- file0
- ranges
-
+
+ kindcontrol
+ edges
- line23
- col3
- file0
+ start
+
+
+ line36
+ col7
+ file0
+
+
+ line36
+ col14
+ file0
+
+
+ end
+
+
+ line38
+ col7
+ file0
+
+
+ line38
+ col8
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line23
- col58
- file0
+ start
+
+
+ line38
+ col7
+ file0
+
+
+ line38
+ col8
+ file0
+
+
+ end
+
+
+ line41
+ col7
+ file0
+
+
+ line41
+ col18
+ file0
+
+
-
- depth2
- extended_message
- Returning to caller
- message
- Returning to caller
-
-
- kindcontrol
- edges
+
+
+ kindevent
+ location
+
+ line24
+ col3
+ file0
+
+ ranges
-
- start
-
-
- line23
- col3
- file0
-
-
- line23
- col16
- file0
-
-
- end
-
-
- line24
- col3
- file0
-
-
- line24
- col16
- file0
-
-
-
+
+
+ line24
+ col3
+ file0
+
+
+ line24
+ col58
+ file0
+
+
-
-
- kindevent
- location
-
- line24
- col3
- file0
+ depth2
+ extended_message
+ Returning to caller
+ message
+ Returning to caller
- ranges
-
+
+ kindcontrol
+ edges
- line24
- col3
- file0
-
-
- line24
- col58
- file0
+ start
+
+
+ line24
+ col3
+ file0
+
+
+ line24
+ col16
+ file0
+
+
+ end
+
+
+ line25
+ col3
+ file0
+
+
+ line25
+ col16
+ file0
+
+
-
- depth2
- extended_message
- Calling anonymous block
- message
- Calling anonymous block
-
-
- kindevent
- location
-
- line29
- col23
- file0
- depth3
- extended_message
- Entered call from 'reallyPerformAction'
- message
- Entered call from 'reallyPerformAction'
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line29
- col23
- file0
-
-
- line29
- col23
- file0
-
-
- end
-
-
- line31
- col5
- file0
-
-
- line31
- col6
- file0
-
-
-
-
-
-
- kindcontrol
- edges
+
+ kindevent
+ location
+
+ line25
+ col3
+ file0
+
+ ranges
-
- start
-
-
- line31
- col5
- file0
-
-
- line31
- col6
- file0
-
-
- end
-
-
- line31
- col9
- file0
-
-
- line31
- col12
- file0
-
-
-
+
+
+ line25
+ col3
+ file0
+
+
+ line25
+ col58
+ file0
+
+
-
-
- kindevent
- location
+ depth2
+ extended_message
+ Calling anonymous block
+ message
+ Calling anonymous block
+
- line31
- col9
- file0
+ kindevent
+ location
+
+ line30
+ col23
+ file0
+
+ depth3
+ extended_message
+ Entered call from 'reallyPerformAction'
+ message
+ Entered call from 'reallyPerformAction'
- ranges
-
+
+ kindcontrol
+ edges
- line31
- col9
- file0
+ start
+
+
+ line30
+ col23
+ file0
+
+
+ line30
+ col23
+ file0
+
+
+ end
+
+
+ line32
+ col5
+ file0
+
+
+ line32
+ col6
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line31
- col12
- file0
+ start
+
+
+ line32
+ col5
+ file0
+
+
+ line32
+ col6
+ file0
+
+
+ end
+
+
+ line32
+ col9
+ file0
+
+
+ line32
+ col12
+ file0
+
+
-
- depth3
- extended_message
- Assuming 'cond' is not equal to 0
- message
- Assuming 'cond' is not equal to 0
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line31
- col9
- file0
-
-
- line31
- col12
- file0
-
-
- end
-
-
- line33
- col7
- file0
-
-
- line33
- col14
- file0
-
-
-
-
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line33
- col7
- file0
-
-
- line33
- col14
- file0
-
-
- end
-
-
- line35
- col7
- file0
-
-
- line35
- col14
- file0
-
-
-
-
-
-
- kindcontrol
- edges
+
+
+ kindevent
+ location
+
+ line32
+ col9
+ file0
+
+ ranges
-
- start
-
-
- line35
- col7
- file0
-
-
- line35
- col14
- file0
-
-
- end
-
-
- line35
- col33
- file0
-
-
- line35
- col38
- file0
-
-
-
+
+
+ line32
+ col9
+ file0
+
+
+ line32
+ col12
+ file0
+
+
-
-
- kindevent
- location
-
- line35
- col33
- file0
+ depth3
+ extended_message
+ Assuming 'cond' is not equal to 0
+ message
+ Assuming 'cond' is not equal to 0
- ranges
-
+
+ kindcontrol
+ edges
- line35
- col33
- file0
+ start
+
+
+ line32
+ col9
+ file0
+
+
+ line32
+ col12
+ file0
+
+
+ end
+
+
+ line34
+ col7
+ file0
+
+
+ line34
+ col14
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line35
- col50
- file0
+ start
+
+
+ line34
+ col7
+ file0
+
+
+ line34
+ col14
+ file0
+
+
+ end
+
+
+ line36
+ col7
+ file0
+
+
+ line36
+ col14
+ file0
+
+
-
- depth3
- extended_message
- Calling anonymous block
- message
- Calling anonymous block
-
-
- kindevent
- location
+
- line49
- col40
- file0
+ kindcontrol
+ edges
+
+
+ start
+
+
+ line36
+ col7
+ file0
+
+
+ line36
+ col14
+ file0
+
+
+ end
+
+
+ line36
+ col33
+ file0
+
+
+ line36
+ col38
+ file0
+
+
+
+
- depth4
- extended_message
- Entered call
- message
- Entered call
-
-
- kindcontrol
- edges
-
-
- start
-
-
- line49
- col40
- file0
-
-
- line49
- col40
- file0
-
-
- end
-
-
- line50
- col5
- file0
-
-
- line50
- col17
- file0
-
-
-
-
-
-
- kindcontrol
- edges
+
+ kindevent
+ location
+
+ line36
+ col33
+ file0
+
+ ranges
-
- start
-
-
- line50
- col5
- file0
-
-
- line50
- col17
- file0
-
-
- end
-
-
- line52
- col5
- file0
-
-
- line52
- col10
- file0
-
-
-
+
+
+ line36
+ col33
+ file0
+
+
+ line36
+ col50
+ file0
+
+
-
-
- kindevent
- location
+ depth3
+ extended_message
+ Calling anonymous block
+ message
+ Calling anonymous block
+
- line52
- col5
- file0
+ kindevent
+ location
+
+ line50
+ col40
+ file0
+
+ depth4
+ extended_message
+ Entered call
+ message
+ Entered call
- ranges
-
+
+ kindcontrol
+ edges
- line52
- col5
- file0
+ start
+
+
+ line50
+ col40
+ file0
+
+
+ line50
+ col40
+ file0
+
+
+ end
+
+
+ line51
+ col5
+ file0
+
+
+ line51
+ col17
+ file0
+
+
+
+
+
+ kindcontrol
+ edges
+
- line52
- col21
- file0
+ start
+
+
+ line51
+ col5
+ file0
+
+
+ line51
+ col17
+ file0
+
+
+ end
+
+
+ line53
+ col5
+ file0
+
+
+ line53
+ col10
+ file0
+
+
-
- depth4
- extended_message
- Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1
- message
- Object leaked: allocated object is not referenced later in this execution path and has a retain count of +1
-
-
- descriptionPotential leak of an object
- categoryMemory (Core Foundation/Objective-C)
- typeLeak
- location
-
- line52
- col5
- file0
-
-
-
-
+
+
+ kindevent
+ location
+
+ line53
+ col5
+ file0
+
+ ranges
+
+
+
+ line53
+ col5
+ file0
+
+
+ line53
+ col21
+ file0
+
+
+
+ depth4
+ extended_message
+ Object leaked: allocated object of type 'NSNumber *' is not referenced later in this execution path and has a retain count of +1
+ message
+ Object leaked: allocated object of type 'NSNumber *' is not referenced later in this execution path and has a retain count of +1
+
+
+ descriptionPotential leak of an object of type 'NSNumber *'
+ categoryMemory (Core Foundation/Objective-C)
+ typeLeak
+ check_nameosx.cocoa.RetainCount
+
+ issue_hash_content_of_line_in_context500e2bbda41c8086771ad98b6bcfdc50
+ location
+
+ line53
+ col5
+ file0
+
+ ExecutedLines
+
+ 0
+
+ 23
+ 24
+ 25
+ 28
+ 29
+ 30
+ 32
+ 34
+ 36
+ 38
+ 41
+ 48
+ 49
+ 50
+ 51
+ 53
+
+
+
+
+ files
+
+ /Volumes/Transcend/code/monorepo/llvm-project/clang/test/Analysis/objc-radar17039661.m
+
-
+
\ No newline at end of file
Index: clang/test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
===================================================================
--- clang/test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
+++ clang/test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
@@ -1299,9 +1299,9 @@
depth0
extended_message
- Call to function 'CFNumberCreate' returns a Core Foundation object of type CFNumberRef with a +1 retain count
+ Call to function 'CFNumberCreate' returns a Core Foundation object of type 'CFNumberRef' with a +1 retain count
message
- Call to function 'CFNumberCreate' returns a Core Foundation object of type CFNumberRef with a +1 retain count
+ Call to function 'CFNumberCreate' returns a Core Foundation object of type 'CFNumberRef' with a +1 retain count
kindcontrol
Index: clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
===================================================================
--- clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
+++ clang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
@@ -155,9 +155,9 @@
depth0
extended_message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
kindcontrol
@@ -822,9 +822,9 @@
depth0
extended_message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
kindcontrol
@@ -1883,9 +1883,9 @@
depth0
extended_message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
kindcontrol
@@ -2006,9 +2006,9 @@
depth0
extended_message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
kindcontrol
@@ -2127,9 +2127,9 @@
depth0
extended_message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
kindcontrol
@@ -3834,12 +3834,12 @@
depth0
extended_message
- Object leaked: allocated object of type MyObj * is not referenced later in this execution path and has a retain count of +1
+ Object leaked: allocated object of type 'MyObj *' is not referenced later in this execution path and has a retain count of +1
message
- Object leaked: allocated object of type MyObj * is not referenced later in this execution path and has a retain count of +1
+ Object leaked: allocated object of type 'MyObj *' is not referenced later in this execution path and has a retain count of +1
- descriptionPotential leak of an object of type MyObj *
+ descriptionPotential leak of an object of type 'MyObj *'
categoryMemory (Core Foundation/Objective-C)
typeLeak
check_nameosx.cocoa.RetainCount
@@ -4298,9 +4298,9 @@
depth0
extended_message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
message
- Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count
+ Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count
kindcontrol
@@ -4571,9 +4571,9 @@
depth0
extended_message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
kindcontrol
@@ -4768,9 +4768,9 @@
depth0
extended_message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
message
- Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count
+ Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count
kindcontrol
Index: clang/test/Analysis/objc-radar17039661.m
===================================================================
--- clang/test/Analysis/objc-radar17039661.m
+++ clang/test/Analysis/objc-radar17039661.m
@@ -1,6 +1,7 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -verify %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -fblocks -analyzer-output=plist-multi-file %s -o %t
-// RUN: FileCheck --input-file=%t %s
+// RUN: cat %t | %diff_plist %S/Inputs/expected-plists/objc-radar17039661.m.plist -
+
@class NSString;
typedef long NSInteger;
typedef unsigned char BOOL;
@@ -58,1276 +59,3 @@
return;
}
}
-
-// CHECK: diagnostics
-// CHECK:
-// CHECK:
-// CHECK: path
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line48
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line48
-// CHECK: col15
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col26
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col38
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line49
-// CHECK: col26
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col26
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line53
-// CHECK: col4
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth0
-// CHECK: extended_message
-// CHECK: Calling 'performAction'
-// CHECK: message
-// CHECK: Calling 'performAction'
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line27
-// CHECK: col1
-// CHECK: file0
-// CHECK:
-// CHECK: depth1
-// CHECK: extended_message
-// CHECK: Entered call from 'runTest'
-// CHECK: message
-// CHECK: Entered call from 'runTest'
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line27
-// CHECK: col1
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line27
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line28
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line28
-// CHECK: col15
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line28
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line28
-// CHECK: col15
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col21
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line29
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line43
-// CHECK: col4
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth1
-// CHECK: extended_message
-// CHECK: Calling 'reallyPerformAction'
-// CHECK: message
-// CHECK: Calling 'reallyPerformAction'
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line22
-// CHECK: col1
-// CHECK: file0
-// CHECK:
-// CHECK: depth2
-// CHECK: extended_message
-// CHECK: Entered call from 'performAction'
-// CHECK: message
-// CHECK: Entered call from 'performAction'
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line22
-// CHECK: col1
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line22
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col16
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line23
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col58
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth2
-// CHECK: extended_message
-// CHECK: Calling anonymous block
-// CHECK: message
-// CHECK: Calling anonymous block
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line29
-// CHECK: col23
-// CHECK: file0
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Entered call from 'reallyPerformAction'
-// CHECK: message
-// CHECK: Entered call from 'reallyPerformAction'
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col23
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col23
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col12
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col12
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Assuming 'cond' is not equal to 0
-// CHECK: message
-// CHECK: Assuming 'cond' is not equal to 0
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col12
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line33
-// CHECK: col30
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col30
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col50
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: NSNumber boxed expression produces an object with a +0 retain count
-// CHECK: message
-// CHECK: NSNumber boxed expression produces an object with a +0 retain count
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col38
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col50
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Calling anonymous block
-// CHECK: message
-// CHECK: Calling anonymous block
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line49
-// CHECK: col40
-// CHECK: file0
-// CHECK:
-// CHECK: depth4
-// CHECK: extended_message
-// CHECK: Entered call
-// CHECK: message
-// CHECK: Entered call
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col40
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col40
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col17
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line50
-// CHECK: col21
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col21
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col39
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col22
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col31
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth4
-// CHECK: extended_message
-// CHECK: Reference count incremented. The object now has a +1 retain count
-// CHECK: message
-// CHECK: Reference count incremented. The object now has a +1 retain count
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col17
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line52
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line52
-// CHECK: col10
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col50
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Returning to caller
-// CHECK: message
-// CHECK: Returning to caller
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col38
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line37
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line37
-// CHECK: col8
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line37
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line37
-// CHECK: col8
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line40
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line40
-// CHECK: col18
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line23
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col58
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth2
-// CHECK: extended_message
-// CHECK: Returning to caller
-// CHECK: message
-// CHECK: Returning to caller
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line23
-// CHECK: col16
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line24
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line24
-// CHECK: col16
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line24
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line24
-// CHECK: col3
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line24
-// CHECK: col58
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth2
-// CHECK: extended_message
-// CHECK: Calling anonymous block
-// CHECK: message
-// CHECK: Calling anonymous block
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line29
-// CHECK: col23
-// CHECK: file0
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Entered call from 'reallyPerformAction'
-// CHECK: message
-// CHECK: Entered call from 'reallyPerformAction'
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col23
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line29
-// CHECK: col23
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col6
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col12
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col12
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Assuming 'cond' is not equal to 0
-// CHECK: message
-// CHECK: Assuming 'cond' is not equal to 0
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col9
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line31
-// CHECK: col12
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line33
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col7
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col14
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col38
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col33
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line35
-// CHECK: col50
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth3
-// CHECK: extended_message
-// CHECK: Calling anonymous block
-// CHECK: message
-// CHECK: Calling anonymous block
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line49
-// CHECK: col40
-// CHECK: file0
-// CHECK:
-// CHECK: depth4
-// CHECK: extended_message
-// CHECK: Entered call
-// CHECK: message
-// CHECK: Entered call
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col40
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line49
-// CHECK: col40
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col17
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindcontrol
-// CHECK: edges
-// CHECK:
-// CHECK:
-// CHECK: start
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line50
-// CHECK: col17
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: end
-// CHECK:
-// CHECK:
-// CHECK: line52
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line52
-// CHECK: col10
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: kindevent
-// CHECK: location
-// CHECK:
-// CHECK: line52
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK: ranges
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: line52
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK: line52
-// CHECK: col21
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
-// CHECK: depth4
-// CHECK: extended_message
-// CHECK: Object leaked: allocated object of type NSNumber * is not referenced later in this execution path and has a retain count of +1
-// CHECK: message
-// CHECK: Object leaked: allocated object of type NSNumber * is not referenced later in this execution path and has a retain count of +1
-// CHECK:
-// CHECK:
-// CHECK: descriptionPotential leak of an object of type NSNumber *
-// CHECK: categoryMemory (Core Foundation/Objective-C)
-// CHECK: typeLeak
-// CHECK: location
-// CHECK:
-// CHECK: line52
-// CHECK: col5
-// CHECK: file0
-// CHECK:
-// CHECK:
-// CHECK:
Index: clang/test/Analysis/osobject-retain-release.cpp
===================================================================
--- clang/test/Analysis/osobject-retain-release.cpp
+++ clang/test/Analysis/osobject-retain-release.cpp
@@ -105,7 +105,7 @@
void use_out_param_leak() {
OSObject *obj;
- write_into_out_param_on_success(&obj); // expected-note{{Call to function 'write_into_out_param_on_success' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'obj'}}
+ write_into_out_param_on_success(&obj); // expected-note{{Call to function 'write_into_out_param_on_success' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'obj'}}
} // expected-warning{{Potential leak of an object stored into 'obj'}}
// expected-note@-1{{Object leaked: object allocated and stored into 'obj' is not referenced later in this execution path and has a retain count of +1}}
@@ -130,8 +130,8 @@
void use_write_two_out_params_leak() {
OSObject *obj1;
OSObject *obj2;
- write_into_two_out_params(&obj1, &obj2); // expected-note{{Call to function 'write_into_two_out_params' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'a'}}
- // expected-note@-1{{Call to function 'write_into_two_out_params' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'b'}}
+ write_into_two_out_params(&obj1, &obj2); // expected-note{{Call to function 'write_into_two_out_params' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'a'}}
+ // expected-note@-1{{Call to function 'write_into_two_out_params' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'b'}}
} // expected-warning{{Potential leak of an object stored into 'obj1'}}
// expected-warning@-1{{Potential leak of an object stored into 'obj2'}}
// expected-note@-2{{Object leaked: object allocated and stored into 'obj1' is not referenced later in this execution path and has a retain count of +1}}
@@ -151,8 +151,8 @@
void use_always_write_into_two_out_params_leak() {
OSObject *obj1;
OSObject *obj2;
- always_write_into_two_out_params(&obj1, &obj2); // expected-note{{Call to function 'always_write_into_two_out_params' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'a'}}
- // expected-note@-1{{Call to function 'always_write_into_two_out_params' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'b'}}
+ always_write_into_two_out_params(&obj1, &obj2); // expected-note{{Call to function 'always_write_into_two_out_params' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'a'}}
+ // expected-note@-1{{Call to function 'always_write_into_two_out_params' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'b'}}
} // expected-warning{{Potential leak of an object stored into 'obj1'}}
// expected-warning@-1{{Potential leak of an object stored into 'obj2'}}
// expected-note@-2{{Object leaked: object allocated and stored into 'obj1' is not referenced later in this execution path and has a retain count of +1}}
@@ -169,7 +169,7 @@
void use_out_param_leak_osreturn_on_nonnull() {
OSObject *obj;
- write_into_out_param_on_nonnull(&obj); // expected-note{{Call to function 'write_into_out_param_on_nonnull' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'obj'}}
+ write_into_out_param_on_nonnull(&obj); // expected-note{{Call to function 'write_into_out_param_on_nonnull' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'obj'}}
} // expected-warning{{Potential leak of an object stored into 'obj'}}
// expected-note@-1{{Object leaked: object allocated and stored into 'obj' is not referenced later in this execution path and has a retain count of +1}}
@@ -190,7 +190,7 @@
void use_write_into_non_retained_out_param_uaf() {
OSObject *obj;
- write_into_non_retained_out_param(&obj); // expected-note{{Call to function 'write_into_non_retained_out_param' writes an OSObject of type OSObject with a +0 retain count into an out parameter 'obj'}}
+ write_into_non_retained_out_param(&obj); // expected-note{{Call to function 'write_into_non_retained_out_param' writes an OSObject of type 'OSObject' with a +0 retain count into an out parameter 'obj'}}
obj->release(); // expected-warning{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
// expected-note@-1{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
}
@@ -205,7 +205,7 @@
void use_void_out_param_osreturn_leak() {
OSObject *obj;
- always_write_into_out_param(&obj); // expected-note{{Call to function 'always_write_into_out_param' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'obj'}}
+ always_write_into_out_param(&obj); // expected-note{{Call to function 'always_write_into_out_param' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'obj'}}
} // expected-warning{{Potential leak of an object stored into 'obj'}}
// expected-note@-1{{Object leaked: object allocated and stored into 'obj' is not referenced later in this execution path and has a retain count of +1}}
@@ -218,7 +218,7 @@
void use_out_param_leak_osreturn() {
OSObject *obj;
- write_into_out_param_on_os_success(&obj); // expected-note{{Call to function 'write_into_out_param_on_os_success' writes an OSObject of type OSObject with a +1 retain count into an out parameter 'obj'}}
+ write_into_out_param_on_os_success(&obj); // expected-note{{Call to function 'write_into_out_param_on_os_success' writes an OSObject of type 'OSObject' with a +1 retain count into an out parameter 'obj'}}
} // expected-warning{{Potential leak of an object stored into 'obj'}}
// expected-note@-1{{Object leaked: object allocated and stored into 'obj' is not referenced later in this execution path and has a retain count of +1}}
@@ -245,14 +245,14 @@
}
void use_os_consume_violation() {
- OSObject *obj = new OSObject; // expected-note{{Operator 'new' returns an OSObject of type OSObject with a +1 retain count}}
+ OSObject *obj = new OSObject; // expected-note{{Operator 'new' returns an OSObject of type 'OSObject' with a +1 retain count}}
os_consume_violation(obj); // expected-note{{Calling 'os_consume_violation'}}
// expected-note@-1{{Returning from 'os_consume_violation'}}
} // expected-note{{Object leaked: object allocated and stored into 'obj' is not referenced later in this execution path and has a retain count of +1}}
// expected-warning@-1{{Potential leak of an object stored into 'obj'}}
void use_os_consume_violation_two_args() {
- OSObject *obj = new OSObject; // expected-note{{Operator 'new' returns an OSObject of type OSObject with a +1 retain count}}
+ OSObject *obj = new OSObject; // expected-note{{Operator 'new' returns an OSObject of type 'OSObject' with a +1 retain count}}
os_consume_violation_two_args(obj, coin()); // expected-note{{Calling 'os_consume_violation_two_args'}}
// expected-note@-1{{Returning from 'os_consume_violation_two_args'}}
} // expected-note{{Object leaked: object allocated and stored into 'obj' is not referenced later in this execution path and has a retain count of +1}}
@@ -323,7 +323,7 @@
}
void check_free_use_after_free() {
- OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
arr->retain(); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
arr->free(); // expected-note{{Object released}}
arr->retain(); // expected-warning{{Reference-counted object is used after it is released}}
@@ -331,13 +331,13 @@
}
unsigned int check_leak_explicit_new() {
- OSArray *arr = new OSArray; // expected-note{{Operator 'new' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = new OSArray; // expected-note{{Operator 'new' returns an OSObject of type 'OSArray' with a +1 retain count}}
return arr->getCount(); // expected-note{{Object leaked: object allocated and stored into 'arr' is not referenced later in this execution path and has a retain count of +1}}
// expected-warning@-1{{Potential leak of an object stored into 'arr'}}
}
unsigned int check_leak_factory() {
- OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
return arr->getCount(); // expected-note{{Object leaked: object allocated and stored into 'arr' is not referenced later in this execution path and has a retain count of +1}}
// expected-warning@-1{{Potential leak of an object stored into 'arr'}}
}
@@ -356,18 +356,18 @@
}
void check_iterator_leak(OSArray *arr) {
- arr->getIterator(); // expected-note{{Call to method 'OSArray::getIterator' returns an OSObject of type OSIterator with a +1 retain count}}
-} // expected-note{{Object leaked: allocated object of type OSIterator is not referenced later}}
- // expected-warning@-1{{Potential leak of an object of type OSIterator}}
+ arr->getIterator(); // expected-note{{Call to method 'OSArray::getIterator' returns an OSObject of type 'OSIterator' with a +1 retain count}}
+} // expected-note{{Object leaked: allocated object of type 'OSIterator' is not referenced later}}
+ // expected-warning@-1{{Potential leak of an object of type 'OSIterator}}'
void check_no_invalidation() {
- OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
OtherStruct::doNothingToArray(arr);
} // 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 method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
OtherStruct other(arr); // expected-warning{{Potential leak}}
// expected-note@-1{{Object leaked}}
}
@@ -394,8 +394,8 @@
};
OSArray *generateArray() {
- return OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
- // expected-note@-1{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ return OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
+ // expected-note@-1{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
}
unsigned int check_leak_good_error_message() {
@@ -413,7 +413,7 @@
return generateArray()->getCount(); // expected-warning{{Potential leak of an object}}
// expected-note@-1{{Calling 'generateArray'}}
// expected-note@-2{{Returning from 'generateArray'}}
- // expected-note@-3{{Object leaked: allocated object of type OSArray is not referenced later in this execution path and has a retain count of +1}}
+ // expected-note@-3{{Object leaked: allocated object of type 'OSArray' is not referenced later in this execution path and has a retain count of +1}}
}
void check_confusing_getters() {
@@ -482,14 +482,14 @@
}
void use_after_release() {
- OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
arr->release(); // expected-note{{Object released}}
arr->getCount(); // expected-warning{{Reference-counted object is used after it is released}}
// expected-note@-1{{Reference-counted object is used after it is released}}
}
void potential_leak() {
- OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type OSArray with a +1 retain count}}
+ OSArray *arr = OSArray::withCapacity(10); // expected-note{{Call to method 'OSArray::withCapacity' returns an OSObject of type 'OSArray' with a +1 retain count}}
arr->retain(); // expected-note{{Reference count incremented. The object now has a +2 retain count}}
arr->release(); // expected-note{{Reference count decremented. The object now has a +1 retain count}}
arr->getCount();
@@ -540,7 +540,7 @@
}
unsigned int warn_on_overrelease_with_unknown_source(ArrayOwner *owner) {
- OSArray *arr = owner->getArraySourceUnknown(); // expected-note{{Call to method 'ArrayOwner::getArraySourceUnknown' returns an OSObject of type OSArray with a +0 retain count}}
+ OSArray *arr = owner->getArraySourceUnknown(); // expected-note{{Call to method 'ArrayOwner::getArraySourceUnknown' returns an OSObject of type 'OSArray' with a +0 retain count}}
arr->release(); // expected-warning{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
// expected-note@-1{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
return arr->getCount();
Index: clang/test/Analysis/retain-release-arc.m
===================================================================
--- clang/test/Analysis/retain-release-arc.m
+++ clang/test/Analysis/retain-release-arc.m
@@ -90,7 +90,7 @@
CFErrorRef error;
CFDictionaryRef testDict = CFPropertyListCreateWithData(kCFAllocatorDefault, (__bridge CFDataRef)plistData, 0, 0, &error);
#if HAS_ARC
- // expected-note@-2 {{Call to function 'CFPropertyListCreateWithData' returns a Core Foundation object of type CFPropertyListRef with a +1 retain count}}
+ // expected-note@-2 {{Call to function 'CFPropertyListCreateWithData' returns a Core Foundation object of type 'CFPropertyListRef' with a +1 retain count}}
#endif
return (__bridge NSDictionary *)testDict;
#if HAS_ARC
Index: clang/test/Analysis/retain-release-path-notes.m
===================================================================
--- clang/test/Analysis/retain-release-path-notes.m
+++ clang/test/Analysis/retain-release-path-notes.m
@@ -49,7 +49,7 @@
}
void creationViaCFCreate () {
- CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count}}
+ CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count}}
return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
@@ -68,7 +68,7 @@
}
void acquisitionViaCFFunction () {
- CFTypeRef leaked = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count}}
+ CFTypeRef leaked = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count}}
CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count}}
return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
@@ -99,19 +99,19 @@
}
void makeCollectableIgnored() {
- CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count}}
+ CFTypeRef leaked = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count}}
CFMakeCollectable(leaked);
NSMakeCollectable(leaked);
return; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}}
}
CFTypeRef CFCopyRuleViolation () {
- CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count}}
+ CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count}}
return object; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
}
CFTypeRef CFGetRuleViolation () {
- CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count}}
+ CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count}}
return object; // expected-warning{{leak}} expected-note{{Object leaked: object allocated and stored into 'object' is returned from a function whose name ('CFGetRuleViolation') does not contain 'Copy' or 'Create'. This violates the naming convention rules given in the Memory Management Guide for Core Foundation}}
}
@@ -227,7 +227,7 @@
// expected-note@-1 {{Method returns an instance of MyObj with a +1 retain count}}
// expected-note@-2 {{Calling 'initX'}}
// expected-note@-3 {{Returning from 'initX'}}
- // expected-note@-4 {{Object leaked: allocated object of type MyObj * is not referenced later in this execution path and has a retain count of +1}}
+ // expected-note@-4 {{Object leaked: allocated object of type 'MyObj *' is not referenced later in this execution path and has a retain count of +1}}
// initI is inlined because the allocation happens within initY
id y = [[MyObj alloc] initY];
// expected-note@-1 {{Calling 'initY'}}
@@ -244,20 +244,20 @@
void CFOverAutorelease() {
- CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type CFTypeRef with a +1 retain count}}
+ CFTypeRef object = CFCreateSomething(); // expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object of type 'CFTypeRef' with a +1 retain count}}
CFAutorelease(object); // expected-note{{Object autoreleased}}
CFAutorelease(object); // expected-note{{Object autoreleased}}
return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased 2 times but the object has a +1 retain count}}
}
void CFAutoreleaseUnowned() {
- CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count}}
+ CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count}}
CFAutorelease(object); // expected-note{{Object autoreleased}}
return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased but has a +0 retain count}}
}
void CFAutoreleaseUnownedMixed() {
- CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type CFTypeRef with a +0 retain count}}
+ CFTypeRef object = CFGetSomething(); // expected-note{{Call to function 'CFGetSomething' returns a Core Foundation object of type 'CFTypeRef' with a +0 retain count}}
CFAutorelease(object); // expected-note{{Object autoreleased}}
[(id)object autorelease]; // expected-note{{Object autoreleased}}
return; // expected-warning{{Object autoreleased too many times}} expected-note{{Object was autoreleased 2 times but the object has a +0 retain count}}
Index: clang/test/Analysis/retaincountchecker-compoundregion.m
===================================================================
--- clang/test/Analysis/retaincountchecker-compoundregion.m
+++ clang/test/Analysis/retaincountchecker-compoundregion.m
@@ -19,7 +19,7 @@
int width = 0;
int height = 0;
CFTypeRef* values = (CFTypeRef[]){
- CFNumberCreate(allocator, kCFNumberSInt32Type, &width), //expected-warning{{Potential leak of an object of type CFNumberRef}}
- CFNumberCreate(allocator, kCFNumberSInt32Type, &height), //expected-warning{{Potential leak of an object of type CFNumberRef}}
+ CFNumberCreate(allocator, kCFNumberSInt32Type, &width), //expected-warning{{Potential leak of an object of type 'CFNumberRef'}}
+ CFNumberCreate(allocator, kCFNumberSInt32Type, &height), //expected-warning{{Potential leak of an object of type 'CFNumberRef'}}
};
}