@@ -891,6 +891,8 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
891891 or
892892 result = this .asLambdaMallocNode ( ) .toString ( ) + " [LambdaMalloc]"
893893 or
894+ result = this .asLambdaArgsNode ( ) .toString ( ) + " [LambdaArgs]"
895+ or
894896 result = this .asLambdaInstancePostUpdateNode ( ) .toString ( ) + " [LambdaPostUpdate]"
895897 or
896898 exists ( DataFlowCall synthcall , ArgumentPosition apos , boolean isPost |
@@ -914,6 +916,8 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
914916
915917 Node asLambdaMallocNode ( ) { this = TNodeLambdaMalloc ( result ) }
916918
919+ Node asLambdaArgsNode ( ) { this = TNodeLambdaArgs ( result ) }
920+
917921 predicate isLambdaArgNode ( DataFlowCall synthcall , ArgumentPosition apos , boolean isPost ) {
918922 this = TNodeLambdaArg ( synthcall , apos , isPost )
919923 }
@@ -929,6 +933,8 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
929933 or
930934 this = TNodeLambdaMalloc ( result )
931935 or
936+ this = TNodeLambdaArgs ( result )
937+ or
932938 exists ( DataFlowCall synthcall |
933939 this = TNodeLambdaArg ( synthcall , _, _) and
934940 lambdaCreation ( result , _, _, synthcall )
@@ -955,6 +961,8 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
955961 or
956962 nodeDataFlowType ( this .asLambdaMallocNode ( ) , result )
957963 or
964+ nodeDataFlowType ( this .asLambdaArgsNode ( ) , result )
965+ or
958966 exists (
959967 DataFlowCall synthcall , ArgumentPosition apos , DataFlowCallable c , ParameterNode p ,
960968 ParameterPosition ppos
@@ -1117,9 +1125,14 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
11171125 }
11181126
11191127 cached
1120- predicate hiddenNode ( Node n ) {
1121- // todo: add all lambda nodes here after end debugging
1122- nodeIsHidden ( n )
1128+ predicate hiddenNode ( NodeEx n ) {
1129+ nodeIsHidden ( n .asNode ( ) ) or
1130+ n .isImplicitReadNode ( _) or
1131+ exists ( n .asLambdaInstancePostUpdateNode ( ) ) or
1132+ exists ( n .asLambdaMallocNode ( ) ) or
1133+ exists ( n .asLambdaArgsNode ( ) ) or
1134+ n .isLambdaArgNode ( _, _, _) or
1135+ hiddenNode ( any ( NodeEx p | n .asParamReturnNode ( ) = p .asNode ( ) ) )
11231136 }
11241137
11251138 cached
@@ -1788,10 +1801,15 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
17881801 or
17891802 //read step from malloc to args
17901803 //lambdaCreation(Node creation, LambdaCallKind kind, DataFlowCallable c, DataFlowCall synthCall)
1791- exists ( DataFlowCall synthcall , LambdaCallKind k , ArgumentPosition apos |
1792- lambdaCreation ( node1 . asLambdaMallocNode ( ) , k , _, synthcall ) and
1793- node2 . isLambdaArgNode ( synthcall , apos , false ) and
1804+ exists ( Node lambda , DataFlowCall synthcall , LambdaCallKind k , ArgumentPosition apos |
1805+ lambdaCreation ( lambda , k , _, synthcall ) and
1806+ lambda = node1 . asLambdaArgsNode ( ) and
17941807 c .getAReadContent ( ) = getLambdaArgumentContent ( k , apos )
1808+ |
1809+ node2 .isLambdaArgNode ( synthcall , apos , false )
1810+ or
1811+ node2 .asLambdaMallocNode ( ) = lambda and
1812+ node2 .( ArgNodeEx ) .argumentOf ( _, apos )
17951813 )
17961814 }
17971815
@@ -2030,12 +2048,13 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
20302048 } or
20312049 TNodeLambdaInstancePostUpdate ( ParameterNode pre ) { isLambdaInstanceParameter ( pre ) } or
20322050 TNodeLambdaMalloc ( Node lambda ) { lambdaCreation ( lambda , _, _, _) } or
2051+ TNodeLambdaArgs ( Node lambda ) { lambdaCreation ( lambda , _, _, _) } or
20332052 TNodeLambdaArg ( DataFlowCall synthcall , ArgumentPosition apos , Boolean ispost ) {
20342053 exists ( DataFlowCallable c , ParameterNode p , ParameterPosition ppos |
20352054 lambdaCreation ( _, _, c , synthcall ) and
20362055 isParameterNode ( p , c , ppos ) and
2037- not isLambdaInstanceParameter ( p ) and
20382056 parameterMatch ( ppos , apos ) and
2057+ not isLambdaInstanceParameter ( p ) and
20392058 exists ( ispost )
20402059 )
20412060 }
@@ -2077,7 +2096,7 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
20772096 model = ""
20782097 )
20792098 or
2080- LambdaFlow:: lambdaFlowsToPostUpdate ( node2 .asLambdaMallocNode ( ) , node1 .asNode ( ) ) and
2099+ LambdaFlow:: lambdaFlowsToPostUpdate ( node2 .asLambdaArgsNode ( ) , node1 .asNode ( ) ) and
20812100 model = ""
20822101 }
20832102
0 commit comments