зеркало из https://github.com/github/codeql.git
CPP: Rename the classes for time structs.
This commit is contained in:
Родитель
2e31f48a7a
Коммит
cb80aa3772
|
@ -238,7 +238,7 @@ class FiletimeYearArithmeticOperationCheckConfiguration extends DataFlow::Config
|
|||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists(StructLikeClass dds, FieldAccess fa, AssignExpr aexpr, Expr e | e = sink.asExpr() |
|
||||
dds instanceof FileTimeStruct and
|
||||
dds instanceof PackedTimeType and
|
||||
fa.getQualifier().getUnderlyingType() = dds and
|
||||
fa.isModified() and
|
||||
aexpr.getAChild() = fa and
|
||||
|
@ -269,7 +269,7 @@ class PossibleYearArithmeticOperationCheckConfiguration extends DataFlow::Config
|
|||
e = node1.asExpr() and
|
||||
aexpr = node2.asExpr()
|
||||
|
|
||||
(dds instanceof FileTimeStruct or dds instanceof DateDataStruct) and
|
||||
(dds instanceof PackedTimeType or dds instanceof UnpackedTimeType) and
|
||||
fa.getQualifier().getUnderlyingType() = dds and
|
||||
aexpr.getLValue() = fa and
|
||||
aexpr.getRValue().getAChild*() = e
|
||||
|
@ -278,7 +278,7 @@ class PossibleYearArithmeticOperationCheckConfiguration extends DataFlow::Config
|
|||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists(StructLikeClass dds, FieldAccess fa, AssignExpr aexpr | aexpr = sink.asExpr() |
|
||||
(dds instanceof FileTimeStruct or dds instanceof DateDataStruct) and
|
||||
(dds instanceof PackedTimeType or dds instanceof UnpackedTimeType) and
|
||||
fa.getQualifier().getUnderlyingType() = dds and
|
||||
fa.isModified() and
|
||||
aexpr.getLValue() = fa
|
||||
|
|
|
@ -26,7 +26,7 @@ class DateStructModifiedFieldAccess extends LeapYearFieldAccess {
|
|||
exists(Field f, StructLikeClass struct |
|
||||
f.getAnAccess() = this and
|
||||
struct.getAField() = f and
|
||||
struct.getUnderlyingType() instanceof DateDataStruct and
|
||||
struct.getUnderlyingType() instanceof UnpackedTimeType and
|
||||
this.isModifiedByArithmeticOperation()
|
||||
)
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ from FunctionCall fcall, TimeConversionFunction trf, Variable var
|
|||
where
|
||||
fcall = trf.getACallToThisFunction() and
|
||||
fcall instanceof ExprInVoidContext and
|
||||
var.getUnderlyingType() instanceof DateDataStruct and
|
||||
var.getUnderlyingType() instanceof UnpackedTimeType and
|
||||
(
|
||||
exists(AddressOfExpr aoe |
|
||||
aoe = fcall.getAnArgument() and
|
||||
|
|
|
@ -7,8 +7,8 @@ import cpp
|
|||
/**
|
||||
* A type that is used to represent time in a 'packed' form, such as an integer.
|
||||
*/
|
||||
class FileTimeStruct extends Type {
|
||||
FileTimeStruct() {
|
||||
class PackedTimeType extends Type {
|
||||
PackedTimeType() {
|
||||
this.getName() = "_FILETIME"
|
||||
or this.getName().matches("_FILETIME %")
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ class FileTimeStruct extends Type {
|
|||
* A type that is used to represent times and dates in an 'unpacked' form, that is,
|
||||
* with separate fields for day, month, year etc.
|
||||
*/
|
||||
class DateDataStruct extends Type {
|
||||
DateDataStruct() {
|
||||
class UnpackedTimeType extends Type {
|
||||
UnpackedTimeType() {
|
||||
this.getName() = "_SYSTEMTIME"
|
||||
or this.getName() = "SYSTEMTIME"
|
||||
or this.getName() = "tm"
|
||||
|
|
Загрузка…
Ссылка в новой задаче