-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rust: Remove references to getResolvedPath and getExtendedCanonicalPath
#20224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,13 @@ import rust | |
|
|
||
| pragma[nomagic] | ||
| private predicate resolvesAsItem(Resolvable r, Item i) { | ||
| r.getResolvedPath() = i.getExtendedCanonicalPath() and | ||
| ( | ||
| r.getResolvedCrateOrigin() = i.getCrateOrigin() | ||
| or | ||
| not r.hasResolvedCrateOrigin() and not i.hasCrateOrigin() | ||
| ) | ||
| none() | ||
| // r.getResolvedPath() = i.getExtendedCanonicalPath() and | ||
| // ( | ||
| // r.getResolvedCrateOrigin() = i.getCrateOrigin() | ||
| // or | ||
| // not r.hasResolvedCrateOrigin() and not i.hasCrateOrigin() | ||
| // ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was used to compare data in DCA, but those reports have now been disabled.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. |
||
| } | ||
|
|
||
| private signature module ResolvableSig { | ||
|
|
@@ -102,7 +103,10 @@ private module PathResolution implements ResolvableSig { | |
| } | ||
|
|
||
| private module RustAnalyzerPathResolution implements CompareSig<PathResolution> { | ||
| predicate isResolvable(PathResolution::Source s) { s.hasResolvedPath() } | ||
| predicate isResolvable(PathResolution::Source s) { | ||
| none() | ||
| //s.hasResolvedPath() | ||
| } | ||
|
|
||
| Item resolve(PathResolution::Source s) { resolvesAsItem(s, result) } | ||
| } | ||
|
|
@@ -157,6 +161,7 @@ private module QlCallGraph implements CompareSig<CallGraph> { | |
| module CallGraphCompare = Compare<CallGraph, RustAnalyzerCallGraph, QlCallGraph>; | ||
|
|
||
| predicate qlMissingCanonicalPath(Addressable a, string path) { | ||
| path = a.getExtendedCanonicalPath() and | ||
| not exists(a.getCanonicalPath(_)) | ||
| none() | ||
| // path = a.getExtendedCanonicalPath() and | ||
| // not exists(a.getCanonicalPath(_)) | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,9 +10,9 @@ module MyFlowConfig implements DataFlow::ConfigSig { | |||||
| predicate isSource(DataFlow::Node source) { source instanceof ThreatModelSource } | ||||||
|
|
||||||
| predicate isSink(DataFlow::Node sink) { | ||||||
| any(CallExpr call | call.getFunction().(PathExpr).getResolvedPath().matches("%::sink")) | ||||||
| .getArgList() | ||||||
| .getAnArg() = sink.asExpr().getExpr() | ||||||
| any(CallExpr call | | ||||||
| call.getFunction().(PathExpr).getPath().getSegment().getIdentifier().getText() = "sink" | ||||||
|
||||||
| call.getFunction().(PathExpr).getPath().getSegment().getIdentifier().getText() = "sink" | |
| call.getFunction().(PathExpr).getPath().toString().matches("%::sink") |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,9 +11,9 @@ module SensitiveDataConfig implements DataFlow::ConfigSig { | |||||
| predicate isSource(DataFlow::Node source) { source instanceof SensitiveData } | ||||||
|
|
||||||
| predicate isSink(DataFlow::Node sink) { | ||||||
| any(CallExpr call | call.getFunction().(PathExpr).getResolvedPath() = "crate::test::sink") | ||||||
| .getArgList() | ||||||
| .getAnArg() = sink.asExpr().getExpr() | ||||||
| any(CallExpr call | | ||||||
| call.getFunction().(PathExpr).getPath().getSegment().getIdentifier().getText() = "sink" | ||||||
|
||||||
| call.getFunction().(PathExpr).getPath().getSegment().getIdentifier().getText() = "sink" | |
| call.getFunction().(PathExpr).getPath().toString() = "sink" |
Uh oh!
There was an error while loading. Please reload this page.