mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #19801 from geoffw0/poem
Rust: Update PoemHandlerParam to use getCanonicalPath
This commit is contained in:
@@ -34,6 +34,11 @@ module Impl {
|
||||
exists(this.getField(pragma[only_bind_into](pos)))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the struct matched by this pattern.
|
||||
*/
|
||||
Struct getStruct() { result = PathResolution::resolvePath(this.getPath()) }
|
||||
|
||||
/** Gets the tuple field that matches the `pos`th pattern of this pattern. */
|
||||
pragma[nomagic]
|
||||
TupleField getTupleField(int pos) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
private import rust
|
||||
private import codeql.rust.Concepts
|
||||
private import codeql.rust.dataflow.DataFlow
|
||||
|
||||
/**
|
||||
* Parameters of a handler function
|
||||
@@ -12,9 +11,8 @@ private import codeql.rust.dataflow.DataFlow
|
||||
private class PoemHandlerParam extends RemoteSource::Range {
|
||||
PoemHandlerParam() {
|
||||
exists(TupleStructPat param |
|
||||
param.getResolvedPath() = ["crate::web::query::Query", "crate::web::path::Path"]
|
||||
|
|
||||
this.asPat().getPat() = param.getAField()
|
||||
this.asPat().getPat() = param.getAField() and
|
||||
param.getStruct().getCanonicalPath() = ["poem::web::query::Query", "poem::web::path::Path"]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user