Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.opentaint.dataflow.jvm.ap.ifds

import it.unimi.dsi.fastutil.longs.LongLongImmutablePair
import it.unimi.dsi.fastutil.longs.LongLongPair
import kotlinx.coroutines.runBlocking
import org.opentaint.dataflow.ap.ifds.AccessPathBase
import org.opentaint.dataflow.ap.ifds.Accessor
import org.opentaint.dataflow.ap.ifds.AnyAccessor
Expand Down Expand Up @@ -33,12 +34,14 @@ import org.opentaint.ir.api.jvm.JIRType
import org.opentaint.ir.api.jvm.JIRTypeVariable
import org.opentaint.ir.api.jvm.JIRUnboundWildcard
import org.opentaint.ir.api.jvm.cfg.JIRCallExpr
import org.opentaint.ir.api.jvm.ext.findClass
import org.opentaint.ir.api.jvm.ext.ifArrayGetElementType
import org.opentaint.ir.api.jvm.ext.isAssignable
import org.opentaint.ir.api.jvm.ext.isSubClassOf
import org.opentaint.ir.api.jvm.ext.objectType
import org.opentaint.ir.api.jvm.ext.unboxIfNeeded
import org.opentaint.ir.impl.features.classpaths.JIRUnknownType
import org.opentaint.ir.impl.features.hierarchyExt
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.LongAdder

Expand Down Expand Up @@ -122,8 +125,18 @@ class JIRFactTypeChecker(private val cp: JIRClasspath) : FactTypeChecker {
}
}

is TypeInfoAccessor -> return FilterResult.Accept
TypeInfoGroupAccessor -> return FilterResult.Accept
is TypeInfoAccessor -> {
val lambdaType = cp.typeOf(cp.findClass(accessor.typeName))
return if (lambdaType.isAssignable(actualType)) {
FilterResult.Accept
} else {
FilterResult.Reject
}
}

TypeInfoGroupAccessor -> return FilterResult.FilterNext(
AccessorFilter(actualType, isLocalCheck)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import org.opentaint.ir.impl.features.classpaths.virtual.JIRVirtualParameter
import org.opentaint.ir.impl.types.JIRClassTypeImpl
import org.opentaint.ir.impl.types.JIRTypedFieldImpl
import org.opentaint.ir.impl.types.substition.JIRSubstitutorImpl
import org.opentaint.jvm.util.name
import java.util.Objects
import java.util.concurrent.ConcurrentHashMap

Expand Down Expand Up @@ -108,7 +109,10 @@ class LambdaAnonymousClassFeature : JIRClasspathExtFeature {
}

val fields = lambda.callSiteArgTypes.mapIndexed { fieldIdx, fieldType ->
val typeName = fieldType.typeName.typeName()
val typeName = when (fieldType) {
is JIRClassType -> fieldType.name
else -> fieldType.typeName
}.typeName()
val field = JIRLambdaField(name = "lambdaCSArg$${fieldIdx}", type = typeName)
.also { it.bind(lambdaClass) }

Expand Down
Loading