@@ -74,6 +74,7 @@ private predicate str_format(ControlFlowNode fromnode, CallNode tonode) {
7474 (
7575 tonode .getAnArg ( ) = fromnode
7676 or
77+ // TODO: if this case is not covered by tonode.getAnArg(), we should change it so it is :\
7778 tonode .getNode ( ) .getAKeyword ( ) .getValue ( ) = fromnode .getNode ( )
7879 )
7980}
@@ -93,10 +94,13 @@ private predicate encode_decode(ControlFlowNode fromnode, CallNode tonode) {
9394/* tonode = str(fromnode)*/
9495private predicate to_str ( ControlFlowNode fromnode , CallNode tonode ) {
9596 tonode .getAnArg ( ) = fromnode and
96- exists ( ClassObject str |
97- tonode .getFunction ( ) .refersTo ( str ) |
98- str = theUnicodeType ( ) or str = theBytesType ( )
99- )
97+ tonode = ClassValue:: str ( ) .getACall ( )
98+ // TODO: should it instead be this?
99+ // (
100+ // tonode = ClassValue::bytes().getACall()
101+ // or
102+ // tonode = ClassValue::unicode().getACall()
103+ // )
100104}
101105
102106/* tonode = fromnode[:] */
@@ -110,11 +114,8 @@ private predicate slice(ControlFlowNode fromnode, SubscriptNode tonode) {
110114
111115/* tonode = os.path.join(..., fromnode, ...) */
112116private predicate os_path_join ( ControlFlowNode fromnode , CallNode tonode ) {
113- exists ( FunctionObject path_join |
114- path_join = ModuleObject:: named ( "os" ) .attr ( "path" ) .( ModuleObject ) .attr ( "join" )
115- and
116- tonode = path_join .getACall ( ) and tonode .getAnArg ( ) = fromnode
117- )
117+ tonode = Value:: named ( "os.path.join" ) .getACall ( )
118+ and tonode .getAnArg ( ) = fromnode
118119}
119120
120121/** A kind of "taint", representing a dictionary mapping str->"taint" */
@@ -125,5 +126,3 @@ class StringDictKind extends DictKind {
125126 }
126127
127128}
128-
129-
0 commit comments