FIR: fix libs filtering for abs/rel paths combinations
Some of the incoming paths "absoluteness" may not match the one of the corresponding library path, and that leaded to incorrect filtering out some items in the deserialized symbol providers. Fix the filtering to account for the mismatch. #KT-57535 fixed
This commit is contained in:
committed by
Space Team
parent
030866cb0b
commit
df35e5431c
+9
-1
@@ -57,7 +57,15 @@ abstract class LibraryPathFilter {
|
||||
|
||||
override fun accepts(path: Path?): Boolean {
|
||||
if (path == null) return false
|
||||
return libs.any { path.startsWith(it) }
|
||||
val isPathAbsolute = path.isAbsolute
|
||||
val absolutePath by lazy(LazyThreadSafetyMode.NONE) { path.toAbsolutePath() }
|
||||
return libs.any {
|
||||
when {
|
||||
it.isAbsolute && !isPathAbsolute -> absolutePath.startsWith(it)
|
||||
!it.isAbsolute && isPathAbsolute -> path.startsWith(it.toAbsolutePath())
|
||||
else -> path.startsWith(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user