Kotlin: Fix CFG for string templates

This commit is contained in:
Ian Lynagh
2021-11-26 12:45:58 +00:00
parent fcbe4331b4
commit 2e5cf92f8a

View File

@@ -459,6 +459,8 @@ private module ControlFlowGraphImpl {
this instanceof LocalVariableDeclExpr and
not this = any(InstanceOfExpr ioe).getLocalVariableDeclExpr()
or
this instanceof StringTemplateExpr
or
this instanceof RValue
or
this instanceof Call // includes both expressions and statements
@@ -548,6 +550,10 @@ private module ControlFlowGraphImpl {
result = e.getArgument(index)
)
or
exists(StringTemplateExpr e | e = this |
result = e.getComponent(index)
)
or
index = 0 and result = this.(ReturnStmt).getResult()
or
index = 0 and result = this.(ThrowStmt).getExpr()