From d5a98f94799ba4e21476ba38220c88d15179b303 Mon Sep 17 00:00:00 2001 From: Tobias Blaschke Date: Fri, 7 Feb 2014 18:09:40 +0100 Subject: [PATCH] InducedCFG: Accept holes in the local Instruction array The Instruction array in InducedCFG contains null-entries. Wheter that's intentional or not, skipp over them. --- .../src/com/ibm/wala/cfg/InducedCFG.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/com.ibm.wala.core/src/com/ibm/wala/cfg/InducedCFG.java b/com.ibm.wala.core/src/com/ibm/wala/cfg/InducedCFG.java index 52ab5ca01..25bef1c0b 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/cfg/InducedCFG.java +++ b/com.ibm.wala.core/src/com/ibm/wala/cfg/InducedCFG.java @@ -42,6 +42,8 @@ import com.ibm.wala.util.graph.GraphIntegrity; import com.ibm.wala.util.graph.GraphIntegrity.UnsoundGraphException; import com.ibm.wala.util.graph.impl.NodeWithNumber; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A {@link ControlFlowGraph} computed from a set of {@link SSAInstruction} instructions. * @@ -49,7 +51,7 @@ import com.ibm.wala.util.graph.impl.NodeWithNumber; * unsuited for flow-sensitive analysis. Someday this should be nuked. */ public class InducedCFG extends AbstractCFG { - + private static final Logger logger = LoggerFactory.getLogger(InducedCFG.class); private static final boolean DEBUG = false; /** @@ -645,10 +647,16 @@ public class InducedCFG extends AbstractCFG 0) { + logger.debug(" Instuction before is: " + instructions[i - 1]); + } + if (i < instructions.length - 1) { + logger.debug(" Instuction after is: " + instructions[i + 1]); + } + continue; } if (instructions[i].iindex == iindex) { return i;