File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010private newtype TNode =
1111 TExprNode ( Expr e ) or
1212 TPartialDefNode ( PartialDefinition pd ) or
13+ TPostConstructorCallNode ( ConstructorCall call ) or
1314 TExplicitParameterNode ( Parameter p ) { exists ( p .getFunction ( ) .getBlock ( ) ) } or
1415 TInstanceParameterNode ( MemberFunction f ) { exists ( f .getBlock ( ) ) and not f .isStatic ( ) } or
1516 TDefinitionByReferenceNode ( VariableAccess va , Expr argument ) {
@@ -233,13 +234,19 @@ class PartialDefNode extends PostUpdateNode, TPartialDefNode {
233234
234235 override Node getPreUpdateNode ( ) { result .asExpr ( ) = pd .getDefinedExpr ( ) }
235236
236- override string toString ( ) { result = pd .toString ( ) }
237-
238237 override Location getLocation ( ) { result = pd .getLocation ( ) }
239238
240239 PartialDefinition getPartialDefinition ( ) { result = pd }
241240}
242241
242+ class PostConstructorCallNode extends PostUpdateNode , TPostConstructorCallNode {
243+ ConstructorCall call ;
244+
245+ PostConstructorCallNode ( ) { this = TPostConstructorCallNode ( call ) }
246+
247+ override Node getPreUpdateNode ( ) { result .asExpr ( ) = call }
248+ }
249+
243250/**
244251 * Gets the `Node` corresponding to `e`.
245252 */
@@ -310,6 +317,8 @@ predicate localFlowStep(Node nodeFrom, Node nodeTo) {
310317 // Expr -> Expr
311318 exprToExprStep_nocfg ( nodeFrom .asExpr ( ) , nodeTo .asExpr ( ) )
312319 or
320+ exprToExprStep_nocfg ( nodeFrom .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) , nodeTo .asExpr ( ) )
321+ or
313322 // Node -> FlowVar -> VariableAccess
314323 exists ( FlowVar var |
315324 (
You can’t perform that action at this time.
0 commit comments