C#: Improve join-order in defaultDelegateConversion

This commit is contained in:
Tom Hvitved
2021-10-22 10:12:18 +02:00
parent 562a57b75b
commit 4e40337d02

View File

@@ -552,11 +552,16 @@ private predicate defaultDynamicConversion(Type fromType, Type toType) {
fromType instanceof RefType and toType instanceof DynamicType
}
pragma[noinline]
private predicate systemDelegateBaseType(RefType t) {
t = any(SystemDelegateClass c).getABaseType*()
}
// This is a deliberate, small cartesian product, so we have manually lifted it to force the
// evaluator to evaluate it in its entirety, rather than trying to optimize it in context.
pragma[noinline]
private predicate defaultDelegateConversion(RefType fromType, RefType toType) {
fromType instanceof DelegateType and toType = any(SystemDelegateClass c).getABaseType*()
fromType instanceof DelegateType and systemDelegateBaseType(toType)
}
private predicate convRefTypeRefType(RefType fromType, RefType toType) {