Skip to content
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

Missing size for typedef #8805

Open
dbartol opened this issue Apr 21, 2022 · 0 comments
Open

Missing size for typedef #8805

dbartol opened this issue Apr 21, 2022 · 0 comments
Labels
bug Something isn't working C++

Comments

@dbartol
Copy link
Contributor

dbartol commented Apr 21, 2022

At least in some situations, the database can wind up with a Type with no size, even though that Type is for a typedef whose underlying type has a known size. This caused bad IR generation, although that was fixable by always using the size of the unspecified type.

To repro, run the following query on the LGTM database for g/nlohmann/json:

private import cpp

from Type t, Type ut, int size
where ut = t.getUnspecifiedType() and size = ut.getSize() and not exists(t.getSize())
select t, ut, size

Expected Result:
No results

Actual Result:
~871 types for which there is no size, despite the unspecified type having a size

I was unable to come up with a small repro in a QL test, so it might be tricky to debug.

@dbartol dbartol added the question Further information is requested label Apr 21, 2022
dbartol added a commit to dbartol/codeql that referenced this issue Apr 21, 2022
See github#8805 for the underlying issue. The symptom was bad IR generation on a large number of functions because we never generated an `IRVariable` for a parameter with the affected type.
@dbartol dbartol added bug Something isn't working C++ and removed question Further information is requested labels Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C++
Projects
None yet
Development

No branches or pull requests

1 participant