C++: Pointer-to-member-function is constant

This commit is contained in:
Jonas Jensen
2019-09-18 13:55:56 +02:00
parent 55edfe4224
commit c90fd32a78
2 changed files with 4 additions and 6 deletions

View File

@@ -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

View File

@@ -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 |