-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: main
Are you sure you want to change the base?
Rust: Regenerate models #21023
Changes from all commits
9cdf63e
8bfce6b
1fbf038
862adec
d784912
da43e8c
76a1e22
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 |
|---|---|---|
|
|
@@ -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?
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'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?
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. Fixes a compile error on this line: final class ParameterPosition extends TParameterPosition {with the error being: |
||
|
|
||
| cached | ||
| newtype TReturnKind = TNormalReturnKind() | ||
|
|
||
|
|
||
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 🙏