[LL FIR] do not update phase if exception occurred
Exception (even PCE) can lead to inconsistent situations, for example, where a function can be marked as resolved, but arguments – not. Also, in this case, it is possible that the function will be marked as resolved to TYPES, but not all its type really resolved ^KTIJ-25582 Fixed
This commit is contained in:
committed by
Space Team
parent
1749bafc30
commit
447e1711da
+6
-1
@@ -171,10 +171,15 @@ internal class LLFirLockProvider(private val checker: LLFirLazyResolveContractCh
|
||||
|
||||
is FirResolvedToPhaseState -> {
|
||||
if (!tryLock(toPhase, stateSnapshot)) continue
|
||||
|
||||
var exceptionOccurred = false
|
||||
try {
|
||||
action()
|
||||
} catch (e: Throwable) {
|
||||
exceptionOccurred = true
|
||||
throw e
|
||||
} finally {
|
||||
val newPhase = if (updatePhase) toPhase else stateSnapshot.resolvePhase
|
||||
val newPhase = if (updatePhase && !exceptionOccurred) toPhase else stateSnapshot.resolvePhase
|
||||
unlock(toPhase = newPhase)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user