@@ -641,6 +641,18 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
641641 c .isKnownOrUnknownElement ( ec ) and
642642 index = ec .getIndex ( ) .asInt ( )
643643 )
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+ )
644656}
645657
646658/**
@@ -668,6 +680,12 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
668680 or
669681 not exists ( e .getValue ( ) .asInt ( ) )
670682 )
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+ )
671689}
672690
673691/**
@@ -676,15 +694,23 @@ predicate readStep(Node node1, ContentSet c, Node node2) {
676694 * in `x.f = newValue`.
677695 */
678696predicate clearsContent ( Node n , ContentSet c ) {
697+ c .isSingleton ( any ( Content:: FieldContent fc ) ) and
679698 n = any ( PostUpdateNode pun | storeStep ( _, c , pun ) ) .getPreUpdateNode ( )
699+ or
700+ n = TPreReturnNodeImpl ( _, false ) and
701+ c .isAnyElement ( )
680702}
681703
682704/**
683705 * Holds if the value that is being tracked is expected to be stored inside content `c`
684706 * at node `n`.
685707 */
686708predicate 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 ) )
688714}
689715
690716class DataFlowType extends TDataFlowType {
0 commit comments