From 2686ac8a671e2f340276119e4e6f08f2be73b664 Mon Sep 17 00:00:00 2001 From: dolby-oss Date: Fri, 24 Aug 2007 01:53:02 +0000 Subject: [PATCH] bug fixes for using slicer on CAst-derived IRs git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1662 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 --- .../com/ibm/wala/ipa/slicer/HeapReachingDefs.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/HeapReachingDefs.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/HeapReachingDefs.java index ef119d6f2..0fdf2a2aa 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/HeapReachingDefs.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/HeapReachingDefs.java @@ -37,9 +37,7 @@ import com.ibm.wala.ipa.modref.ExtendedHeapModel; import com.ibm.wala.ipa.modref.ModRef; import com.ibm.wala.ipa.slicer.HeapStatement.ReturnCaller; import com.ibm.wala.ipa.slicer.Statement.Kind; -import com.ibm.wala.ssa.IR; -import com.ibm.wala.ssa.SSAInstruction; -import com.ibm.wala.ssa.SSAInvokeInstruction; +import com.ibm.wala.ssa.*; import com.ibm.wala.ssa.analysis.ExplodedControlFlowGraph; import com.ibm.wala.ssa.analysis.ExplodedControlFlowGraph.ExplodedBasicBlock; import com.ibm.wala.util.collections.Filter; @@ -209,6 +207,10 @@ public class HeapReachingDefs { return result; } + public String toString() { + return delegate.toString(); + } + public void clear() { Assertions.UNREACHABLE(); delegate.clear(); @@ -492,7 +494,7 @@ public class HeapReachingDefs { public UnaryOperator getEdgeTransferFunction(IBasicBlock src, IBasicBlock dst) { ExplodedBasicBlock s = (ExplodedBasicBlock) src; - if (s.getInstruction() != null && !(s.getInstruction() instanceof SSAInvokeInstruction) + if (s.getInstruction() != null && !(s.getInstruction() instanceof SSAAbstractInvokeInstruction) && !cfg.getNormalSuccessors(src).contains(dst)) { // if the edge only happens due to exceptional control flow, then no // heap locations @@ -546,7 +548,7 @@ public class HeapReachingDefs { if (s == null) { return null; } else { - if (s instanceof SSAInvokeInstruction) { + if (s instanceof SSAAbstractInvokeInstruction) { // it's a normal statement ... we better be able to find it in the // domain. Statement st = ssaInstructionIndex2Statement.get(b.getLastInstructionIndex());