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 {
188
188
none ( )
189
189
}
190
190
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
+
191
194
SemType getUnknownExprType ( Expr expr ) { result = getSemanticType ( expr .getResultIRType ( ) ) }
192
195
193
196
class BasicBlock = IR:: IRBlock ;
@@ -270,7 +273,13 @@ module SemanticExprConfig {
270
273
getSemanticExpr ( v .asInstruction ( ) ) = sourceExpr
271
274
}
272
275
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
+ }
274
283
275
284
SsaVariable getAPhiInput ( SsaVariable v ) {
276
285
exists ( IR:: PhiInstruction instr | v .asInstruction ( ) = instr |
You can’t perform that action at this time.
0 commit comments