File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1230,6 +1230,20 @@ module ConstructorForwarding {
12301230 )
12311231 }
12321232
1233+ private predicate nullPointerConversion ( Type t ) {
1234+ t instanceof Cpp:: PointerType or t instanceof FunctionPointerType
1235+ }
1236+
1237+ private predicate booleanConversion ( Type t ) {
1238+ t instanceof Cpp:: PointerType
1239+ or
1240+ t instanceof FunctionPointerType
1241+ or
1242+ t instanceof Cpp:: ArrayType
1243+ or
1244+ t instanceof RoutineType
1245+ }
1246+
12331247 private predicate referenceAcceptsCategory ( Cpp:: ReferenceType t , ValueCategory category ) {
12341248 if t instanceof Cpp:: LValueReferenceType
12351249 then
@@ -1373,6 +1387,12 @@ module ConstructorForwarding {
13731387 arithmeticConversion ( argType )
13741388 or
13751389 pointerConversion ( argType , paramType )
1390+ or
1391+ argType instanceof NullPointerType and
1392+ nullPointerConversion ( paramType )
1393+ or
1394+ booleanConversion ( argType ) and
1395+ paramType instanceof BoolType
13761396 )
13771397 }
13781398
You can’t perform that action at this time.
0 commit comments