Skip to content

Commit 293f903

Browse files
committed
Kotlin: Avoid another cause of ConcurrentModificationException with 1.9
1 parent 0076d8a commit 293f903

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5317,7 +5317,10 @@ open class KotlinFileExtractor(
53175317
private fun extractTypeAccessRecursive(t: IrType, location: Label<out DbLocation>, parent: Label<out DbExprparent>, idx: Int, typeContext: TypeContext = TypeContext.OTHER): Label<out DbExpr> {
53185318
val typeAccessId = extractTypeAccess(useType(t, typeContext), location, parent, idx)
53195319
if (t is IrSimpleType) {
5320-
t.arguments.forEachIndexed { argIdx, arg ->
5320+
// From 1.9, the list might change when we call erase,
5321+
// so we make a copy that it is safe to iterate over.
5322+
val argumentsCopy = t.arguments.toList()
5323+
argumentsCopy.forEachIndexed { argIdx, arg ->
53215324
extractWildcardTypeAccessRecursive(arg, location, typeAccessId, argIdx)
53225325
}
53235326
}

0 commit comments

Comments
 (0)