Visitar URL original
Convert shared CFG construction library to a parameterized module by hvitved · Pull Request #13509 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260412032853/https://github.com/github/codeql/pull/13509
Skip to content

Convert shared CFG construction library to a parameterized module#13509

Merged
hvitved merged 6 commits intogithub:mainfrom
hvitved:cfg-pack
Aug 3, 2023
Merged

Convert shared CFG construction library to a parameterized module#13509
hvitved merged 6 commits intogithub:mainfrom
hvitved:cfg-pack

Conversation

@hvitved
Copy link
Copy Markdown
Contributor

@hvitved hvitved commented Jun 20, 2023 •

This PR converts the existing ControlFlowGraphImplShared.qll to a parameterized module, and puts it into a new controlflow QL pack (where, eventually, we can also put stuff like basic blocks and guards). In this PR, only Ruby is adopting the new shared library; I plan to do C# follow-up, and perhaps Swift (unless @github/codeql-swift beats me to it).

Whitespace-insensitive commit-by-commit review is suggested.

The PR makes use of extends inside parameterized modules, which is only publicly supported in 2.14.0 (expected to be released July 11th), so cannot be merged until then (this is the reason why the CI check Compile all queries using the latest stable CodeQL CLI currently fails). 2.14.0 has now been released, so this PR is safe to merge.

@hvitved hvitved force-pushed the cfg-pack branch 3 times, most recently from 5067515 to 37d9875 Compare June 27, 2023 13:59
@hvitved hvitved marked this pull request as ready for review June 27, 2023 14:27
@hvitved hvitved requested a review from a team as a code owner June 27, 2023 14:27
@hvitved hvitved requested review from MathiasVP and aibaars July 3, 2023 08:31
Copy link
Copy Markdown
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me. I wonder if we can get rid of most uses of AstNode. Also don't forget to include the new library in the list of things to release in the build file.

* For more information about locations see [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
signature class LocationSig {
/** Gets the 1-based line number (inclusive) where this location starts. */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you "forgot" getFile on purpose, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because that would require a File class in scope.

Copy link
Copy Markdown
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once DCA comes back happy 🤞!

@hvitved hvitved merged commit e011480 into github:main Aug 3, 2023
@hvitved hvitved deleted the cfg-pack branch August 3, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants