-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rust: Setup inline flow test library #17959
Conversation
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.
Missing a bindingset
, otherwise LGTM.
result = src.asExpr().(CallExpr).getArgList().getArg(0).toString() | ||
} | ||
|
||
string getArgString(DataFlow::Node src, DataFlow::Node sink) { |
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.
Missing bindingset[src, sink]
.
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.
What does the bindingset
do here? From the documentation I thought that it was only to be used for predicates over infinite types. For several of the other language there is no bindingset
annotation on getArgString
. Go for instance. Should it ideally also be added there? Or is it not needed there for some reason?
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.
It is needed to avoid creating a Cartesian product. It should also be added for Go.
} | ||
|
||
string getArgString(DataFlow::Node src, DataFlow::Node sink) { | ||
(if exists(getSourceArgString(src)) then result = getSourceArgString(src) else result = "") and |
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.
I know this was copied from Ruby, but the idiomatic way to write things like this is
result = getSourceArgString(src)
or
not exists(getSourceArgString(src)) and
result = ""
Setup inline flow test library for Rust. It doesn't output anything, but it should once other things begin to work 😉