File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
cpp/ql/src/semmle/code/cpp/dataflow/internal Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -313,17 +313,18 @@ DefinitionByReferenceNode definitionByReferenceNodeFromArgument(Expr argument) {
313313UninitializedNode uninitializedNode ( LocalVariable v ) { result .getLocalVariable ( ) = v }
314314
315315private module ThisFlow {
316- private Node thisAccessNode ( ControlFlowNode cfn ) {
317- result .( ImplicitParameterNode ) .getFunction ( ) .getBlock ( ) = cfn or
318- result .asExpr ( ) .( ThisExpr ) = cfn
319- }
320-
321316 private int basicBlockThisIndex ( BasicBlock b , Node thisNode ) {
322- thisNode = thisAccessNode ( b .getNode ( result ) )
317+ // The implicit `this` parameter node is given a very negative offset to
318+ // make space for any `ConstructorFieldInit`s there may be between it and
319+ // the block contents.
320+ thisNode .( ImplicitParameterNode ) .getFunction ( ) .getBlock ( ) = b and
321+ result = - 1000
322+ or
323+ b .getNode ( result ) = thisNode .asExpr ( ) .( ThisExpr )
323324 }
324325
325326 private int thisRank ( BasicBlock b , Node thisNode ) {
326- thisNode = rank [ result ] ( thisAccessNode ( _ ) as node order by basicBlockThisIndex ( b , node ) )
327+ thisNode = rank [ result ] ( Node n , int i | i = basicBlockThisIndex ( b , n ) | n order by i )
327328 }
328329
329330 private int lastThisRank ( BasicBlock b ) { result = max ( thisRank ( b , _) ) }
You can’t perform that action at this time.
0 commit comments