FIR CFA: add edges from maybe-throwing statements to catch/finally

This commit is contained in:
pyos
2023-01-16 12:15:52 +01:00
committed by teamcity
parent ef208d9eac
commit 8aa50e9446
17 changed files with 156 additions and 64 deletions
@@ -0,0 +1,21 @@
// !SKIP_TXT
fun exc(flag: Boolean) {
if (flag) throw RuntimeException()
}
fun test(flag: Boolean) {
var x: Any?
x = ""
try {
<!UNUSED_VALUE!>x =<!> null
exc(flag)
<!UNUSED_VALUE!>x =<!> 1
exc(!flag)
x = ""
} catch (e: Throwable) {
// all bad - could come here from either call
<!DEBUG_INFO_SMARTCAST!>x<!>.length
x.<!UNRESOLVED_REFERENCE!>inc<!>()
}
}