@@ -339,7 +339,7 @@ abstract class LibraryTypeDataFlow extends Type {
339339 * Holds if data may flow from `source` to `sink` when calling callable `c`.
340340 *
341341 * `sourceAp` describes the contents of `source` that flows to `sink`
342- * (if any), and `sinkContent ` describes the contents of `sink` that it
342+ * (if any), and `sinkAp ` describes the contents of `sink` that it
343343 * flows to (if any).
344344 */
345345 pragma [ nomagic]
@@ -728,6 +728,49 @@ class SystemLazyFlow extends LibraryTypeDataFlow, SystemLazyClass {
728728 }
729729}
730730
731+ /** Data flow for `System.Nullable<>`. */
732+ class SystemNullableFlow extends LibraryTypeDataFlow , SystemNullableStruct {
733+ override predicate callableFlow (
734+ CallableFlowSource source , AccessPath sourceAp , CallableFlowSink sink , AccessPath sinkAp ,
735+ SourceDeclarationCallable c , boolean preservesValue
736+ ) {
737+ preservesValue = true and
738+ c .( Constructor ) .getDeclaringType ( ) = this and
739+ source = getFlowSourceArg ( c , 0 , sourceAp ) and
740+ sourceAp = AccessPath:: empty ( ) and
741+ sink = TCallableFlowSinkReturn ( ) and
742+ sinkAp = AccessPath:: property ( this .getValueProperty ( ) )
743+ or
744+ preservesValue = true and
745+ c = this .getAGetValueOrDefaultMethod ( ) and
746+ source = TCallableFlowSourceQualifier ( ) and
747+ sourceAp = AccessPath:: property ( this .getValueProperty ( ) ) and
748+ sink = TCallableFlowSinkReturn ( ) and
749+ sinkAp = AccessPath:: empty ( )
750+ or
751+ preservesValue = false and
752+ c = this .getHasValueProperty ( ) .getGetter ( ) and
753+ source = TCallableFlowSourceQualifier ( ) and
754+ sourceAp = AccessPath:: property ( this .getValueProperty ( ) ) and
755+ sink = TCallableFlowSinkReturn ( ) and
756+ sinkAp = AccessPath:: empty ( )
757+ or
758+ preservesValue = true and
759+ c = this .getAGetValueOrDefaultMethod ( ) and
760+ source = getFlowSourceArg ( c , 0 , _) and
761+ sourceAp = AccessPath:: empty ( ) and
762+ sink = TCallableFlowSinkReturn ( ) and
763+ sinkAp = AccessPath:: empty ( )
764+ or
765+ preservesValue = false and
766+ c = this .getValueProperty ( ) .getGetter ( ) and
767+ source = TCallableFlowSourceQualifier ( ) and
768+ sourceAp = AccessPath:: empty ( ) and
769+ sink = TCallableFlowSinkReturn ( ) and
770+ sinkAp = AccessPath:: empty ( )
771+ }
772+ }
773+
731774/** Data flow for `System.Collections.IEnumerable` (and sub types). */
732775class IEnumerableFlow extends LibraryTypeDataFlow , RefType {
733776 IEnumerableFlow ( ) { this .getABaseType * ( ) instanceof SystemCollectionsIEnumerableInterface }
0 commit comments