Merge pull request #19801 from geoffw0/poem

Rust: Update PoemHandlerParam to use getCanonicalPath
This commit is contained in:
Tom Hvitved
2025-06-23 13:53:39 +02:00
committed by GitHub
2 changed files with 7 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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"]
)
}
}