mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Handle __builtin_addressof.
This commit is contained in:
@@ -51,6 +51,9 @@ class BuiltInVarArgCopy extends BuiltInOperation, @vacopyexpr {
|
||||
*/
|
||||
class BuiltInNoOp extends BuiltInOperation, @noopexpr {
|
||||
override string toString() { result = "__noop" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
override string getCanonicalQLClass() { result = "BuiltInNoOp" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,6 +61,9 @@ class BuiltInNoOp extends BuiltInOperation, @noopexpr {
|
||||
*/
|
||||
class BuiltInOperationOffsetOf extends BuiltInOperation, @offsetofexpr {
|
||||
override string toString() { result = "__offsetof" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
override string getCanonicalQLClass() { result = "BuiltInOperationOffsetOf" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,6 +71,9 @@ class BuiltInOperationOffsetOf extends BuiltInOperation, @offsetofexpr {
|
||||
*/
|
||||
class BuiltInIntAddr extends BuiltInOperation, @intaddrexpr {
|
||||
override string toString() { result = "__INTADDR__" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
override string getCanonicalQLClass() { result = "BuiltInIntAddr" }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,6 +248,9 @@ class BuiltInOperationBuiltInAddressOf extends UnaryOperation, BuiltInOperation,
|
||||
or result = this.getOperand().(ReferenceDereferenceExpr).getChild(0).(Access).getTarget()
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
override string getCanonicalQLClass() { result = "BuiltInOperationBuiltInAddressOf" }
|
||||
|
||||
override string getOperator() { result = "__builtin_addressof" }
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ clang.cpp:
|
||||
# 5| params:
|
||||
# 5| body: [Block]: { ... }
|
||||
# 6| 0: [ReturnStmt]: return ...
|
||||
# 6| 0: [???]: __builtin_addressof ...
|
||||
# 6| 0: [BuiltInOperationBuiltInAddressOf]: __builtin_addressof ...
|
||||
# 6| Type = [IntPointerType]: int *
|
||||
# 6| ValueCategory = prvalue
|
||||
# 6| 0: [VariableAccess]: globalInt
|
||||
|
||||
Reference in New Issue
Block a user