From 8018bfe2c36bf16e964602726c9a447e89d2418b Mon Sep 17 00:00:00 2001 From: Dominik Helm Date: Thu, 1 Apr 2021 10:57:15 +0200 Subject: [PATCH] Allow merging of indirect callee parameters if they are equal --- .../org/opalj/br/fpcf/properties/cg/Callees.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OPAL/br/src/main/scala/org/opalj/br/fpcf/properties/cg/Callees.scala b/OPAL/br/src/main/scala/org/opalj/br/fpcf/properties/cg/Callees.scala index db7cf50aa8..e63c9a61b6 100644 --- a/OPAL/br/src/main/scala/org/opalj/br/fpcf/properties/cg/Callees.scala +++ b/OPAL/br/src/main/scala/org/opalj/br/fpcf/properties/cg/Callees.scala @@ -299,10 +299,12 @@ sealed class ConcreteCallees( _incompleteCallSites ++ incompleteCallSites, _indirectCallReceivers.unionWith( indirectCallReceivers, - (_, r, l) ⇒ { + (_, l, r) ⇒ { r.unionWith( l, - (_, _, _) ⇒ throw new UnknownError("Indirect callee derived by two analyses") + (_, vl, vr) ⇒ + if (vl == vr) vl + else throw new UnknownError("Incompatible receivers for indirect call") ) } ), @@ -311,7 +313,9 @@ sealed class ConcreteCallees( (_, r, l) ⇒ { r.unionWith( l, - (_, _, _) ⇒ throw new UnknownError("Indirect callee derived by two analyses") + (_, vl, vr) ⇒ + if (vl == vr) vl + else throw new UnknownError("Incompatible parameters for indirect call") ) } )