File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
python/ql/src/semmle/python Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -401,13 +401,18 @@ class ControlFlowNode extends @py_flow_node {
401401 py_true_successors ( this , _) or py_false_successors ( this , _)
402402 }
403403
404- /* Gets a CFG node that corresponds to a child of the AST node for this node */
405- pragma [ noinline]
406404 ControlFlowNode getAChild ( ) {
407- this . getNode ( ) . getAChildNode ( ) = result . getNode ( ) and
405+ result = this . getExprChild ( ) and
408406 result .getBasicBlock ( ) .dominates ( this .getBasicBlock ( ) )
409407 }
410408
409+ /* join-ordering helper for `getAChild() */
410+ pragma [ noinline]
411+ private ControlFlowNode getExprChild ( ) {
412+ this .getNode ( ) .( Expr ) .getAChildNode ( ) = result .getNode ( ) and
413+ not this instanceof UnaryExprNode
414+ }
415+
411416}
412417
413418
@@ -1058,7 +1063,7 @@ class BasicBlock extends @py_flow_node {
10581063 this .strictlyDominates ( other )
10591064 }
10601065
1061- BasicBlock getImmediateDominator ( ) {
1066+ cached BasicBlock getImmediateDominator ( ) {
10621067 this .getAPart ( ) .getImmediateDominator ( ) = result .getAPart ( )
10631068 }
10641069
You can’t perform that action at this time.
0 commit comments