mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
C++/C#: More sanity checks for IRType
This commit is contained in:
@@ -610,7 +610,9 @@ class FloatingPointType extends ArithmeticType {
|
||||
(
|
||||
kind >= 24 and kind <= 32
|
||||
or
|
||||
kind = 38
|
||||
kind >= 38 and kind <= 42
|
||||
or
|
||||
kind >= 45 and kind <= 50
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -258,4 +258,6 @@ module IRTypeSanity {
|
||||
strictcount(type.getIRType()) > 1 and
|
||||
message = "`LanguageType` " + type.getAQlClass() + " has multiple `IRType`s: " + concat(type.getIRType().toString(), ", ")
|
||||
}
|
||||
|
||||
import Language::LanguageTypeSanity
|
||||
}
|
||||
|
||||
@@ -532,3 +532,13 @@ string getOpaqueTagIdentityString(Type tag) {
|
||||
hasOpaqueType(tag, _) and
|
||||
result = getTypeIdentityString(tag)
|
||||
}
|
||||
|
||||
module LanguageTypeSanity {
|
||||
query predicate missingCppType(Type type, string message) {
|
||||
not exists(getTypeForPRValue(type)) and
|
||||
exists(type.getSize()) and
|
||||
// `ProxyClass`es have a size, but only appear in uninstantiated templates
|
||||
not type instanceof ProxyClass and
|
||||
message = "Type does not have an associated `CppType`."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,3 +17,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -17,3 +17,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -17,3 +17,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -17,3 +17,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -17,3 +17,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -548,3 +548,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -696,3 +696,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
@@ -557,3 +557,4 @@ missingCanonicalLanguageType
|
||||
multipleCanonicalLanguageTypes
|
||||
missingIRType
|
||||
multipleIRTypes
|
||||
missingCppType
|
||||
|
||||
Reference in New Issue
Block a user