From 97083468b708fd1b50746476bad75f320098cff5 Mon Sep 17 00:00:00 2001 From: sjfink Date: Mon, 20 Aug 2007 21:34:08 +0000 Subject: [PATCH] bug fix for PointerAnalysisImpl.toString and tests for this git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1636 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 --- .../ibm/wala/ipa/callgraph/propagation/PointsToMap.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java index c825aeb63..a4feea602 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointsToMap.java @@ -84,7 +84,7 @@ public class PointsToMap { } /** - * If key is unifed, returns the representative for p. + * If key is unified, returns the representative for p. * * @param p * @return get(p) @@ -96,6 +96,9 @@ public class PointsToMap { } } int i = pointerKeys.getMappedIndex(p); + if (i == -1) { + return null; + } int repI = uf.find(i); PointsToSetVariable result = (PointsToSetVariable) pointsToSets.get(repI); if (result != null && p instanceof FilteredPointerKey && (!(result.getPointerKey() instanceof FilteredPointerKey))) { @@ -170,8 +173,8 @@ public class PointsToMap { } public boolean isImplicit(PointerKey p) { - int i = findOrCreateIndex(p); - return pointsToSets.get(i) == IMPLICIT; + int i = getIndex(p); + return i != -1 && pointsToSets.get(i) == IMPLICIT; } protected int getNumberOfPointerKeys() {