File tree Expand file tree Collapse file tree
powershell/ql/lib/semmle/code/powershell Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,6 +249,15 @@ module API {
249249 result = this .getContent ( contents .getAReadContent ( ) )
250250 }
251251
252+ /**
253+ * Gets a representative for the instanceof field of the given `name`.
254+ */
255+ pragma [ inline]
256+ Node getField ( string name ) {
257+ // This predicate is currently not 'inline_late' because 'name' can be an input or output
258+ Impl:: fieldEdge ( this .getAnEpsilonSuccessor ( ) , name , result )
259+ }
260+
252261 /**
253262 * Gets a representative for an arbitrary element of this collection.
254263 */
@@ -615,6 +624,15 @@ module API {
615624 contentEdge ( pred , any ( DataFlow:: ContentSet set | set .isAnyElement ( ) ) .getAReadContent ( ) , succ )
616625 }
617626
627+ cached
628+ predicate fieldEdge ( Node pred , string name , Node succ ) {
629+ exists ( DataFlow:: ContentSet set , DataFlow:: Content:: FieldContent fc |
630+ fc .getLowerCaseName ( ) = name and
631+ set .isSingleton ( fc ) and
632+ contentEdge ( pred , set .getAReadContent ( ) , succ )
633+ )
634+ }
635+
618636 cached
619637 predicate parameterEdge ( Node pred , DataFlowDispatch:: ParameterPosition paramPos , Node succ ) {
620638 exists ( DataFlowPrivate:: ParameterNodeImpl parameter , DataFlow:: CallableNode callable |
You can’t perform that action at this time.
0 commit comments