diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/temporaryVals/TemporaryVals.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/temporaryVals/TemporaryVals.kt index 513c16bf621..5c71da7e2e4 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/temporaryVals/TemporaryVals.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/temporaryVals/TemporaryVals.kt @@ -82,6 +82,10 @@ class TemporaryValsAnalyzer { } } + // Don't run analysis if we have no potential temporary val stores. + if (potentiallyTemporaryStores.isEmpty()) + return emptyList() + // If the method is big, and we couldn't eliminate enough temporary variable store candidates, // bail out, treat all variables as non-temporary. // Here we estimate memory required to store all relevant information as O(N * M * K),