File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,8 +70,7 @@ private module VirtualDispatch {
7070 // Call return
7171 exists ( DataFlowCall call , ReturnKind returnKind |
7272 other = getAnOutNode ( call , returnKind ) and
73- src .( ReturnNode ) .getKind ( ) = returnKind and
74- call .getStaticCallTarget ( ) = src .getEnclosingCallable ( )
73+ returnNodeWithKindAndEnclosingCallable ( src , returnKind , call .getStaticCallTarget ( ) )
7574 ) and
7675 allowFromArg = false
7776 or
@@ -125,6 +124,16 @@ private module VirtualDispatch {
125124 }
126125 }
127126
127+ /**
128+ * A ReturnNode with its ReturnKind and its enclosing callable.
129+ *
130+ * Used to fix a join ordering issue in flowsFrom.
131+ */
132+ private predicate returnNodeWithKindAndEnclosingCallable ( ReturnNode node , ReturnKind kind , DataFlowCallable callable ) {
133+ node .getKind ( ) = kind and
134+ node .getEnclosingCallable ( ) = callable
135+ }
136+
128137 /** Call through a function pointer. */
129138 private class DataSensitiveExprCall extends DataSensitiveCall {
130139 DataSensitiveExprCall ( ) { not exists ( this .getStaticCallTarget ( ) ) }
You can’t perform that action at this time.
0 commit comments