github / github/codeql

Missing size for typedef

Đang mở
#8,805 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug C++
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

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:

```ql
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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.