[Low Level FIR] fix one case in CME when traversing FIR tree
Before extra child nodes of classes were visited during declaration by ClassId search. If some other thread was mutating this tree, CME could happen this is a fix of one case from ^KTIJ-21791
This commit is contained in:
+13
@@ -81,3 +81,16 @@ public inline fun checkWithAttachmentBuilder(
|
||||
buildErrorWithAttachment(message(), buildAttachment = buildAttachment)
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
public inline fun requireWithAttachmentBuilder(
|
||||
condition: Boolean,
|
||||
message: () -> String,
|
||||
buildAttachment: ExceptionAttachmentBuilder.() -> Unit = {}
|
||||
) {
|
||||
contract { returns() implies (condition) }
|
||||
|
||||
if (!condition) {
|
||||
buildErrorWithAttachment(message(), buildAttachment = buildAttachment)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user