@@ -347,7 +347,7 @@ abstract class LibraryTypeDataFlow extends Type {
347347 * Holds if data may flow from `source` to `sink` when calling callable `c`.
348348 *
349349 * `sourceAp` describes the contents of `source` that flows to `sink`
350- * (if any), and `sinkContent ` describes the contents of `sink` that it
350+ * (if any), and `sinkAp ` describes the contents of `sink` that it
351351 * flows to (if any).
352352 */
353353 pragma [ nomagic]
@@ -736,6 +736,49 @@ class SystemLazyFlow extends LibraryTypeDataFlow, SystemLazyClass {
736736 }
737737}
738738
739+ /** Data flow for `System.Nullable<>`. */
740+ class SystemNullableFlow extends LibraryTypeDataFlow , SystemNullableStruct {
741+ override predicate callableFlow (
742+ CallableFlowSource source , AccessPath sourceAp , CallableFlowSink sink , AccessPath sinkAp ,
743+ SourceDeclarationCallable c , boolean preservesValue
744+ ) {
745+ preservesValue = true and
746+ c .( Constructor ) .getDeclaringType ( ) = this and
747+ source = getFlowSourceArg ( c , 0 , sourceAp ) and
748+ sourceAp = AccessPath:: empty ( ) and
749+ sink = TCallableFlowSinkReturn ( ) and
750+ sinkAp = AccessPath:: property ( this .getValueProperty ( ) )
751+ or
752+ preservesValue = true and
753+ c = this .getAGetValueOrDefaultMethod ( ) and
754+ source = TCallableFlowSourceQualifier ( ) and
755+ sourceAp = AccessPath:: property ( this .getValueProperty ( ) ) and
756+ sink = TCallableFlowSinkReturn ( ) and
757+ sinkAp = AccessPath:: empty ( )
758+ or
759+ preservesValue = false and
760+ c = this .getHasValueProperty ( ) .getGetter ( ) and
761+ source = TCallableFlowSourceQualifier ( ) and
762+ sourceAp = AccessPath:: property ( this .getValueProperty ( ) ) and
763+ sink = TCallableFlowSinkReturn ( ) and
764+ sinkAp = AccessPath:: empty ( )
765+ or
766+ preservesValue = true and
767+ c = this .getAGetValueOrDefaultMethod ( ) and
768+ source = getFlowSourceArg ( c , 0 , _) and
769+ sourceAp = AccessPath:: empty ( ) and
770+ sink = TCallableFlowSinkReturn ( ) and
771+ sinkAp = AccessPath:: empty ( )
772+ or
773+ preservesValue = false and
774+ c = this .getValueProperty ( ) .getGetter ( ) and
775+ source = TCallableFlowSourceQualifier ( ) and
776+ sourceAp = AccessPath:: empty ( ) and
777+ sink = TCallableFlowSinkReturn ( ) and
778+ sinkAp = AccessPath:: empty ( )
779+ }
780+ }
781+
739782/** Data flow for `System.Collections.IEnumerable` (and sub types). */
740783class IEnumerableFlow extends LibraryTypeDataFlow , RefType {
741784 IEnumerableFlow ( ) { this .getABaseType * ( ) instanceof SystemCollectionsIEnumerableInterface }
0 commit comments