File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
lib/StaticAnalyzer/Checkers/WebKit
test/Analysis/Checkers/WebKit Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -108,17 +108,16 @@ class ForwardDeclChecker : public Checker<check::ASTDecl<TranslationUnitDecl>> {
108
108
RTC.visitTypedef (TD);
109
109
auto QT = TD->getUnderlyingType ().getCanonicalType ();
110
110
if (BR->getSourceManager ().isInSystemHeader (TD->getBeginLoc ())) {
111
- if (auto *Type = QT.getTypePtrOrNull (); Type && QT-> isPointerType () )
111
+ if (auto *Type = QT.getTypePtrOrNull ())
112
112
SystemTypes.insert (Type);
113
113
}
114
114
}
115
115
116
116
bool isUnknownType (QualType QT) const {
117
- auto *Type = QT.getTypePtrOrNull ();
118
- if (!Type)
119
- return false ;
120
117
auto *CanonicalType = QT.getCanonicalType ().getTypePtrOrNull ();
121
- auto PointeeQT = Type->getPointeeType ();
118
+ if (!CanonicalType)
119
+ return false ;
120
+ auto PointeeQT = CanonicalType->getPointeeType ();
122
121
auto *PointeeType = PointeeQT.getTypePtrOrNull ();
123
122
if (!PointeeType)
124
123
return false ;
@@ -128,7 +127,8 @@ class ForwardDeclChecker : public Checker<check::ASTDecl<TranslationUnitDecl>> {
128
127
auto Name = R->getName ();
129
128
return !R->hasDefinition () && !RTC.isUnretained (QT) &&
130
129
!SystemTypes.contains (CanonicalType) &&
131
- !Name.starts_with (" Opaque" ) && Name != " _NSZone" ;
130
+ !SystemTypes.contains (PointeeType) && !Name.starts_with (" Opaque" ) &&
131
+ Name != " _NSZone" ;
132
132
}
133
133
134
134
void visitRecordDecl (const RecordDecl *RD, const Decl *DeclWithIssue) const {
Original file line number Diff line number Diff line change 25
25
26
26
Obj* provide_obj_ptr ();
27
27
void receive_obj_ptr (Obj* p = nullptr );
28
+ sqlite3* open_db ();
29
+ void close_db (sqlite3*);
28
30
29
31
Obj* ptr (Obj* arg) {
30
32
receive_obj_ptr (provide_obj_ptr ());
34
36
receive_obj_ptr (arg);
35
37
receive_obj_ptr (nullptr );
36
38
receive_obj_ptr ();
39
+ auto * db = open_db ();
40
+ close_db (db);
37
41
return obj;
38
42
}
39
43
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ struct MemberVariable {
16
16
T* obj { nullptr };
17
17
};
18
18
19
+ typedef struct sqlite3 sqlite3;
20
+
19
21
typedef unsigned char uint8_t ;
20
22
21
23
enum os_log_type_t : uint8_t {
You can’t perform that action at this time.
0 commit comments