File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed
csharp/ql/test/utils/modelgenerator/dataflow
shared/mad/codeql/mad/modelgenerator/internal Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -639,7 +639,7 @@ public DImpl(string s)
639
639
public override string Prop { get { return tainted ; } }
640
640
}
641
641
642
- public abstract class BaseContent
642
+ public abstract class BaseContent
643
643
{
644
644
public abstract object GetValue ( ) ;
645
645
@@ -961,3 +961,30 @@ public string ConcatValueOnBase2(string other, Base2 b2)
961
961
return other + b2 . GetValue ( ) ;
962
962
}
963
963
}
964
+
965
+ public class AvoidDuplicateLifted
966
+ {
967
+ public class A
968
+ {
969
+ public object Prop { get ; set ; }
970
+
971
+ // contentbased-summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this].Property[Models.AvoidDuplicateLifted+A.Prop];ReturnValue;value;dfc-generated
972
+ // summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated
973
+ public virtual object GetValue ( )
974
+ {
975
+ return Prop ;
976
+ }
977
+ }
978
+
979
+ public class B : A
980
+ {
981
+ private object field ;
982
+
983
+ // No content based summary as field is a dead synthetic field.
984
+ // summary=Models;AvoidDuplicateLifted+A;true;GetValue;();;Argument[this];ReturnValue;taint;df-generated
985
+ public override object GetValue ( )
986
+ {
987
+ return field ;
988
+ }
989
+ }
990
+ }
Original file line number Diff line number Diff line change @@ -881,7 +881,13 @@ module MakeModelGenerator<
881
881
string captureMixedFlow ( DataFlowSummaryTargetApi api , boolean lift ) {
882
882
result = ContentSensitive:: captureFlow ( api , lift )
883
883
or
884
- not exists ( ContentSensitive:: captureFlow ( api , _) ) and
884
+ not exists ( DataFlowSummaryTargetApi api0 |
885
+ ( api0 = api or api .lift ( ) = api0 ) and
886
+ exists ( ContentSensitive:: captureFlow ( api0 , false ) )
887
+ or
888
+ api0 .lift ( ) = api .lift ( ) and
889
+ exists ( ContentSensitive:: captureFlow ( api0 , true ) )
890
+ ) and
885
891
result = captureFlow ( api ) and
886
892
lift = true
887
893
}
@@ -895,7 +901,8 @@ module MakeModelGenerator<
895
901
not exists ( DataFlowSummaryTargetApi api0 , boolean lift |
896
902
exists ( captureMixedFlow ( api0 , lift ) ) and
897
903
(
898
- lift = false and api0 = api
904
+ lift = false and
905
+ ( api0 = api or api0 = api .lift ( ) )
899
906
or
900
907
lift = true and api0 .lift ( ) = api .lift ( )
901
908
)
You can’t perform that action at this time.
0 commit comments