Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e5cf92

Browse files
committed
Kotlin: Fix CFG for string templates
1 parent fcbe433 commit 2e5cf92

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ private module ControlFlowGraphImpl {
459459
this instanceof LocalVariableDeclExpr and
460460
not this = any(InstanceOfExpr ioe).getLocalVariableDeclExpr()
461461
or
462+
this instanceof StringTemplateExpr
463+
or
462464
this instanceof RValue
463465
or
464466
this instanceof Call // includes both expressions and statements
@@ -548,6 +550,10 @@ private module ControlFlowGraphImpl {
548550
result = e.getArgument(index)
549551
)
550552
or
553+
exists(StringTemplateExpr e | e = this |
554+
result = e.getComponent(index)
555+
)
556+
or
551557
index = 0 and result = this.(ReturnStmt).getResult()
552558
or
553559
index = 0 and result = this.(ThrowStmt).getExpr()

0 commit comments

Comments
 (0)