Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
Rust: Regenerate models#21023
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
Uh oh!
There was an error while loading. Please reload this page.
Rust: Regenerate models #21023
Changes from all commits
9cdf63e8bfce6b1fbf038862adecd784912da43e8c76a1e22File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -306,7 +306,11 @@ predicate indexAssignment( | ||
| not index.getResolvedTarget().fromSource() | ||
| } | ||
| module RustDataFlow implements InputSig<Location> { | ||
| signature module RustDataFlowInputSig { | ||
| predicate includeDynamicTargets(); | ||
| } | ||
| module RustDataFlowGen<RustDataFlowInputSig Input> implements InputSig<Location> { | ||
| private import Aliases | ||
| private import codeql.rust.dataflow.DataFlow | ||
| private import Node as Node | ||
| @@ -462,7 +466,11 @@ module RustDataFlow implements InputSig<Location> { | ||
| /** Gets a viable implementation of the target of the given `Call`. */ | ||
| DataFlowCallable viableCallable(DataFlowCall call) { | ||
| exists(Call c | c = call.asCall() | | ||
| result.asCfgScope() = c.getARuntimeTarget() | ||
| ( | ||
| if Input::includeDynamicTargets() | ||
| then result.asCfgScope() = c.getARuntimeTarget() | ||
| else result.asCfgScope() = c.getStaticTarget() | ||
| ) | ||
| or | ||
| result.asSummarizedCallable() = getStaticTargetExt(c) | ||
| ) | ||
| @@ -935,6 +943,12 @@ module RustDataFlow implements InputSig<Location> { | ||
| class DataFlowSecondLevelScope = Void; | ||
| } | ||
| module RustDataFlowInput implements RustDataFlowInputSig { | ||
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. private? ContributorAuthor 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's used over in | ||
| predicate includeDynamicTargets() { any() } | ||
| } | ||
| module RustDataFlow = RustDataFlowGen<RustDataFlowInput>; | ||
| /** Provides logic related to captured variables. */ | ||
| module VariableCapture { | ||
| private import codeql.rust.internal.CachedStages | ||
| @@ -1110,7 +1124,7 @@ private module Cached { | ||
| } | ||
| cached | ||
| newtype TParameterPosition = | ||
| newtype TParameterPositionImpl = | ||
| TPositionalParameterPosition(int i) { | ||
| i in [0 .. max([any(ParamList l).getNumberOfParams(), any(ArgList l).getNumberOfArgs()]) - 1] | ||
| or | ||
| @@ -1121,6 +1135,8 @@ private module Cached { | ||
| TClosureSelfParameterPosition() or | ||
| TSelfParameterPosition() | ||
| final class TParameterPosition = TParameterPositionImpl; | ||
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 does this achieve? ContributorAuthor 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. Fixes a compile error on this line: finalclassParameterPositionextendsTParameterPosition{with the error being: | ||
| cached | ||
| newtype TReturnKind = TNormalReturnKind() | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genis for "generic" or something. Suggestions for better names are very welcome 🙏