Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 751263d

Browse files
committed
C++: Use ConvertToBaseInstruction in IR data flow
This should make virtual dispatch work also for virtual bases.
1 parent 7758b43 commit 751263d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowDispatch.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ private predicate overrideMayAffectCall(
5757
* should usually be fewer classes than calls.
5858
*
5959
* If a value is cast several classes up in the hierarchy, that will be modeled
60-
* as a chain of `ConvertToNonVirtualBaseInstruction`s and will cause the search to start
60+
* as a chain of `ConvertToBaseInstruction`s and will cause the search to start
6161
* from each of them and pass through subsequent ones. There might be
6262
* performance to gain by stopping before a second upcast and reconstructing
6363
* the full chain in a "big-step" recursion after this one.
6464
*/
6565
private predicate nodeMayHaveClass(Class derived, DataFlow::Node node) {
66-
exists(ConvertToNonVirtualBaseInstruction toBase |
66+
exists(ConvertToBaseInstruction toBase |
6767
derived = toBase.getDerivedClass() and
6868
overrideMayAffectCall(derived, _, toBase.getEnclosingFunction(), _, _) and
6969
node.asInstruction() = toBase

0 commit comments

Comments
 (0)