mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
C++: Pointer-to-member-function is constant
This commit is contained in:
@@ -61,6 +61,10 @@ private predicate constantAddressPointer(Expr pointer) {
|
||||
// tells us how it's going to be used.
|
||||
pointer.(FunctionAccess).getType() instanceof FunctionPointerType
|
||||
or
|
||||
// Pointer to member function. These accesses are always pointers even though
|
||||
// their type is `RoutineType`.
|
||||
pointer.(FunctionAccess).getTarget() instanceof MemberFunction
|
||||
or
|
||||
addressConstantVariable(pointer.(VariableAccess).getTarget()) and
|
||||
pointer.getType().getUnderlyingType() instanceof PointerType
|
||||
or
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
| pointer_to_member__pmIsConst | pointer_to_member.cpp:33:3:36:31 | declaration | pointer_to_member.cpp:36:11:36:30 | initializer for pms | Standard edge, only from QL |
|
||||
| pointer_to_member__pmIsConst | pointer_to_member.cpp:33:3:36:31 | declaration | pointer_to_member.cpp:37:1:37:1 | return ... | Standard edge, only from extractor |
|
||||
| pointer_to_member__pmIsConst | pointer_to_member.cpp:36:11:36:30 | initializer for pms | pointer_to_member.cpp:36:13:36:19 | x1 | Standard edge, only from QL |
|
||||
| pointer_to_member__pmIsConst | pointer_to_member.cpp:36:11:36:30 | {...} | pointer_to_member.cpp:37:1:37:1 | return ... | Standard edge, only from QL |
|
||||
| pointer_to_member__pmIsConst | pointer_to_member.cpp:36:13:36:19 | x1 | pointer_to_member.cpp:36:22:36:28 | f1 | Standard edge, only from QL |
|
||||
| pointer_to_member__pmIsConst | pointer_to_member.cpp:36:22:36:28 | f1 | pointer_to_member.cpp:36:11:36:30 | {...} | Standard edge, only from QL |
|
||||
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | call to C | staticlocals.cpp:30:1:30:1 | return ... | Standard edge, only from QL |
|
||||
| staticlocals__staticlocals_f2 | file://:0:0:0:0 | initializer for c | file://:0:0:0:0 | call to C | Standard edge, only from QL |
|
||||
| staticlocals__staticlocals_f2 | staticlocals.cpp:29:5:29:17 | declaration | file://:0:0:0:0 | initializer for c | Standard edge, only from QL |
|
||||
|
||||
Reference in New Issue
Block a user