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
Go: enable data flow consistency checks (and fix some) #14547
base: main
Are you sure you want to change the base?
Go: enable data flow consistency checks (and fix some) #14547
Conversation
This can be run on an existing database to check for any assumptions of the data flow library which do not hold.
It wasn't updated when MkImplicitVarargsSlice was added as a branch of TNode. This meant that it gave no result for `ImplicitVarargsSlice`s in function calls used to initialise variables declared at file level.
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.
Looks reasonable -- just a few minor questions and comments.
I also couldn't find any reference of this actually getting run in the build logs. Is there a way to verify that this works as expected other than deliberately introducing a failure locally?
go/ql/lib/change-notes/2023-10-20-enclosing-callable-for-external-files.md
Outdated
Show resolved
Hide resolved
go/ql/consistency-queries/qlpack.yml
Outdated
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.
Question: why does this get its own qlpack?
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.
Reason 1: all the other languages do it...
…nal-files.md Co-authored-by: Michael B. Gale <mbg@github.com>
|
It isn't currently run in CI. I'm not sure what other languages do. I stumbled across some experimental tests using it for python. It's a bit unclear to me what test code it should be run on. I've just been running it on some databases I already had handy. |
|
It seems the standard way to run it in CI is to add it to the consistency queries, so it's run on all tests. But we can't really do that till we've made all the queries have zero results. |
This PR enables the data flow consistency checks for go, and fixes a problem which was highlighted that not all nodes have a result for
nodeGetEnclosingCallable. This is done by making a new branch ofTDataFlowCallablecalledTExternalFileScopewhich is used only as a return value fornodeGetEnclosingCallablewhen a node exists in an external file (i.e. one which is not in the project being analyzed).