mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C#: Narrow string interpolation expressions to a specific single file in testcase.
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import csharp
|
||||
|
||||
query predicate inserts(InterpolatedStringExpr expr, Expr e) { expr.getAnInsert() = e }
|
||||
private predicate inSpecificSource(Expr expr) {
|
||||
expr.getFile().getBaseName() = "ConstInterpolatedString.cs"
|
||||
}
|
||||
|
||||
query predicate inserts(InterpolatedStringExpr expr, Expr e) {
|
||||
expr.getAnInsert() = e and inSpecificSource(expr)
|
||||
}
|
||||
|
||||
query predicate texts(InterpolatedStringExpr expr, StringLiteral literal) {
|
||||
expr.getAText() = literal
|
||||
expr.getAText() = literal and inSpecificSource(expr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user