@@ -641,6 +641,18 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
641
641
c .isKnownOrUnknownElement ( ec ) and
642
642
index = ec .getIndex ( ) .asInt ( )
643
643
)
644
+ or
645
+ c .isAnyElement ( ) and
646
+ exists ( CfgNode cfgNode |
647
+ node1 = TPreReturnNodeImpl ( cfgNode , false ) and
648
+ node2 .( ReturnNodeImpl ) .getCfgScope ( ) = cfgNode .getScope ( )
649
+ )
650
+ or
651
+ exists ( CfgNode cfgNode |
652
+ node1 = TImplicitWrapNode ( cfgNode , true ) and
653
+ c .isAnyElement ( ) and
654
+ node2 .( ReturnNodeImpl ) .getCfgScope ( ) = cfgNode .getScope ( )
655
+ )
644
656
}
645
657
646
658
/**
@@ -668,6 +680,12 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
668
680
or
669
681
not exists ( e .getValue ( ) .asInt ( ) )
670
682
)
683
+ or
684
+ exists ( CfgNode cfgNode |
685
+ node1 = TPreReturnNodeImpl ( cfgNode , true ) and
686
+ node2 = TImplicitWrapNode ( cfgNode , true ) and
687
+ c .isSingleton ( any ( Content:: KnownElementContent ec ) )
688
+ )
671
689
}
672
690
673
691
/**
@@ -676,15 +694,23 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
676
694
* in `x.f = newValue`.
677
695
*/
678
696
predicate clearsContent ( Node n , ContentSet c ) {
697
+ c .isSingleton ( any ( Content:: FieldContent fc ) ) and
679
698
n = any ( PostUpdateNode pun | storeStep ( _, c , pun ) ) .getPreUpdateNode ( )
699
+ or
700
+ n = TPreReturnNodeImpl ( _, false ) and
701
+ c .isAnyElement ( )
680
702
}
681
703
682
704
/**
683
705
* Holds if the value that is being tracked is expected to be stored inside content `c`
684
706
* at node `n`.
685
707
*/
686
708
predicate expectsContent ( Node n , ContentSet c ) {
687
- none ( ) // TODO
709
+ n = TPreReturnNodeImpl ( _, true ) and
710
+ c .isKnownOrUnknownElement ( _)
711
+ or
712
+ n = TImplicitWrapNode ( _, false ) and
713
+ c .isSingleton ( any ( Content:: UnknownElementContent ec ) )
688
714
}
689
715
690
716
class DataFlowType extends TDataFlowType {
0 commit comments