Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df447c0

Browse files
committed
Python: Remove flow from getAttributeName
1 parent ceb2496 commit df447c0

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

python/ql/src/experimental/dataflow/internal/Attributes.qll

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,7 @@ private class SetAttrCallAsAttrWrite extends AttrWrite, CfgNode {
137137
override ExprNode getAttributeNameExpr() { result.asCfgNode() = node.getName() }
138138

139139
override string getAttributeName() {
140-
// TODO track this back using local flow
141-
exists(StrConst s, Node nodeFrom |
142-
s = nodeFrom.asExpr() and
143-
simpleLocalFlowStep*(nodeFrom, this.getAttributeNameExpr()) and
144-
result = s.getText()
145-
)
140+
result = this.getAttributeNameExpr().asExpr().(StrConst).getText()
146141
}
147142
}
148143

@@ -220,10 +215,6 @@ private class GetAttrCallAsAttrRead extends AttrRead, CfgNode {
220215
override ExprNode getAttributeNameExpr() { result.asCfgNode() = node.getName() }
221216

222217
override string getAttributeName() {
223-
exists(StrConst s, Node nodeFrom |
224-
s = nodeFrom.asExpr() and
225-
simpleLocalFlowStep*(nodeFrom, this.getAttributeNameExpr()) and
226-
result = s.getText()
227-
)
218+
result = this.getAttributeNameExpr().asExpr().(StrConst).getText()
228219
}
229220
}

0 commit comments

Comments
 (0)