mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C++: Work around lack of size for enum type
This commit is contained in:
@@ -16,6 +16,13 @@ class Enum extends UserType, IntegralOrEnumType {
|
||||
*/
|
||||
override string explain() { result = "enum " + this.getName() }
|
||||
|
||||
override int getSize() {
|
||||
// Workaround for extractor bug CPP-348: No size information for enums.
|
||||
// If the extractor didn't provide a size, assume four bytes.
|
||||
result = UserType.super.getSize() or
|
||||
not exists(UserType.super.getSize()) and result = 4
|
||||
}
|
||||
|
||||
/** See `Type.isDeeplyConst` and `Type.isDeeplyConstBelow`. Internal. */
|
||||
override predicate isDeeplyConstBelow() { any() } // No subparts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user