Skip to content

C++: Don't generate IR for functions with bad ASTs #517

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

Merged
merged 4 commits into from
Nov 22, 2018

Conversation

dave-bartolomeo
Copy link
Contributor

Many of the IR sanity check failures I've hit when running on real-world snapshots are due to the original ASTs being ill-formed in one way or another. This PR provides a filtering mechanism to avoid generating IR for functions that match an isInvalidFunction predicate, and then implements that predicate to filter out the issues that I already know about. I'll open an individual extractor bug for each of these.

See individual commit messages for more detail.

This change provides a mechanism by which a query can tell the IR package to only create IR for certain functions. This is mostly useful for "PrintIR.qll", which uses this feature to avoid the expense of creating IR for functions that aren't going to be printed.
An slightly invalid AST can cause IR construction to generate extremely bad IR. This change provides a single place to detect invalid ASTs, and to skip IR construction for the affected functions.
@dave-bartolomeo dave-bartolomeo requested a review from a team as a code owner November 22, 2018 00:54
@jbj jbj added the C++ label Nov 22, 2018
@jbj jbj merged commit e062851 into github:master Nov 22, 2018
jbj added a commit to jbj/ql that referenced this pull request Nov 22, 2018
This test was failing due to a semantic merge conflict between github#509,
which added `UninitializedInstruction`, and github#517, which added new test
code that would get `UninitializedInstruction`s in it after merging with github#509.
cklin pushed a commit that referenced this pull request May 23, 2022
…nder-odasa

Unify two implementations of GetExtractorPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants