File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,9 @@ module SemanticExprConfig {
188188 none ( )
189189 }
190190
191+ /** Holds if no range analysis should be performed on the phi edges in `f`. */
192+ private predicate excludeFunction ( Cpp:: Function f ) { count ( f .getEntryPoint ( ) ) > 1 }
193+
191194 SemType getUnknownExprType ( Expr expr ) { result = getSemanticType ( expr .getResultIRType ( ) ) }
192195
193196 class BasicBlock = IR:: IRBlock ;
@@ -270,7 +273,13 @@ module SemanticExprConfig {
270273 getSemanticExpr ( v .asInstruction ( ) ) = sourceExpr
271274 }
272275
273- predicate phi ( SsaVariable v ) { v .asInstruction ( ) instanceof IR:: PhiInstruction }
276+ predicate phi ( SsaVariable v ) {
277+ exists ( IR:: PhiInstruction phi , Cpp:: Function f |
278+ phi = v .asInstruction ( ) and
279+ f = phi .getEnclosingFunction ( ) and
280+ not excludeFunction ( f )
281+ )
282+ }
274283
275284 SsaVariable getAPhiInput ( SsaVariable v ) {
276285 exists ( IR:: PhiInstruction instr | v .asInstruction ( ) = instr |
You can’t perform that action at this time.
0 commit comments