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>> {
108108 RTC.visitTypedef (TD);
109109 auto QT = TD->getUnderlyingType ().getCanonicalType ();
110110 if (BR->getSourceManager ().isInSystemHeader (TD->getBeginLoc ())) {
111- if (auto *Type = QT.getTypePtrOrNull (); Type && QT-> isPointerType () )
111+ if (auto *Type = QT.getTypePtrOrNull ())
112112 SystemTypes.insert (Type);
113113 }
114114 }
115115
116116 bool isUnknownType (QualType QT) const {
117- auto *Type = QT.getTypePtrOrNull ();
118- if (!Type)
119- return false ;
120117 auto *CanonicalType = QT.getCanonicalType ().getTypePtrOrNull ();
121- auto PointeeQT = Type->getPointeeType ();
118+ if (!CanonicalType)
119+ return false ;
120+ auto PointeeQT = CanonicalType->getPointeeType ();
122121 auto *PointeeType = PointeeQT.getTypePtrOrNull ();
123122 if (!PointeeType)
124123 return false ;
@@ -128,7 +127,8 @@ class ForwardDeclChecker : public Checker<check::ASTDecl<TranslationUnitDecl>> {
128127 auto Name = R->getName ();
129128 return !R->hasDefinition () && !RTC.isUnretained (QT) &&
130129 !SystemTypes.contains (CanonicalType) &&
131- !Name.starts_with (" Opaque" ) && Name != " _NSZone" ;
130+ !SystemTypes.contains (PointeeType) && !Name.starts_with (" Opaque" ) &&
131+ Name != " _NSZone" ;
132132 }
133133
134134 void visitRecordDecl (const RecordDecl *RD, const Decl *DeclWithIssue) const {
Original file line number Diff line number Diff line change 2525
2626Obj* provide_obj_ptr ();
2727void receive_obj_ptr (Obj* p = nullptr );
28+ sqlite3* open_db ();
29+ void close_db (sqlite3*);
2830
2931Obj* ptr (Obj* arg) {
3032 receive_obj_ptr (provide_obj_ptr ());
3436 receive_obj_ptr (arg);
3537 receive_obj_ptr (nullptr );
3638 receive_obj_ptr ();
39+ auto * db = open_db ();
40+ close_db (db);
3741 return obj;
3842}
3943
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ struct MemberVariable {
1616 T* obj { nullptr };
1717};
1818
19+ typedef struct sqlite3 sqlite3;
20+
1921typedef unsigned char uint8_t ;
2022
2123enum os_log_type_t : uint8_t {
You can’t perform that action at this time.
0 commit comments