Skip to content

Commit 0897b00

Browse files
committed
revert removal of redundant inline casts in some python files
1 parent d36c66c commit 0897b00

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

python/ql/lib/semmle/python/frameworks/Django.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ private module PrivateDjango {
18201820
/** Gets a reference to this class. */
18211821
private DataFlow::TypeTrackingNode getARef(DataFlow::TypeTracker t) {
18221822
t.start() and
1823-
result.asExpr() = this.getParent()
1823+
result.asExpr().(ClassExpr) = this.getParent()
18241824
or
18251825
exists(DataFlow::TypeTracker t2 | result = this.getARef(t2).track(t2, t))
18261826
}

python/ql/lib/semmle/python/frameworks/Flask.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ module Flask {
188188

189189
FlaskViewClass() {
190190
this.getABase() = Views::View::subclassRef().getAUse().asExpr() and
191-
api_node.getAnImmediateUse().asExpr() = this.getParent()
191+
api_node.getAnImmediateUse().asExpr().(ClassExpr) = this.getParent()
192192
}
193193

194194
/** Gets a function that could handle incoming requests, if any. */
@@ -213,7 +213,7 @@ module Flask {
213213
class FlaskMethodViewClass extends FlaskViewClass {
214214
FlaskMethodViewClass() {
215215
this.getABase() = Views::MethodView::subclassRef().getAUse().asExpr() and
216-
api_node.getAnImmediateUse().asExpr() = this.getParent()
216+
api_node.getAnImmediateUse().asExpr().(ClassExpr) = this.getParent()
217217
}
218218

219219
override Function getARequestHandler() {
@@ -294,7 +294,7 @@ module Flask {
294294
override Function getARequestHandler() {
295295
exists(DataFlow::LocalSourceNode func_src |
296296
func_src.flowsTo(this.getViewArg()) and
297-
func_src.asExpr() = result.getDefinition()
297+
func_src.asExpr().(CallableExpr) = result.getDefinition()
298298
)
299299
or
300300
exists(FlaskViewClass vc |

python/ql/lib/semmle/python/frameworks/Tornado.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private module Tornado {
102102
/** Gets a reference to this class. */
103103
private DataFlow::TypeTrackingNode getARef(DataFlow::TypeTracker t) {
104104
t.start() and
105-
result.asExpr() = this.getParent()
105+
result.asExpr().(ClassExpr) = this.getParent()
106106
or
107107
exists(DataFlow::TypeTracker t2 | result = this.getARef(t2).track(t2, t))
108108
}

0 commit comments

Comments
 (0)