adapt to different notions of exception types for different languages
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2931 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
257cb0d5d5
commit
4da002f47c
|
@ -17,6 +17,10 @@ public interface Language {
|
|||
return TypeReference.JavaLangObject;
|
||||
}
|
||||
|
||||
public TypeReference getThrowableType() {
|
||||
return TypeReference.JavaLangThrowable;
|
||||
}
|
||||
|
||||
public TypeReference getConstantType(Object o) {
|
||||
if (o instanceof String) {
|
||||
return TypeReference.JavaLangString;
|
||||
|
@ -43,6 +47,8 @@ public interface Language {
|
|||
|
||||
TypeReference getRootType();
|
||||
|
||||
TypeReference getThrowableType();
|
||||
|
||||
TypeReference getConstantType(Object o);
|
||||
|
||||
boolean isNullType(TypeReference type);
|
||||
|
|
|
@ -334,7 +334,9 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
|
|||
List<ProgramCounter> peis = getIncomingPEIs(ir, ir.getExitBlock());
|
||||
PointerKey exception = getPointerKeyForExceptionalReturnValue(node);
|
||||
|
||||
IClass c = node.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable);
|
||||
TypeReference throwableType =
|
||||
node.getMethod().getDeclaringClass().getClassLoader().getLanguage().getThrowableType();
|
||||
IClass c = node.getClassHierarchy().lookupClass(throwableType);
|
||||
addExceptionDefConstraints(ir, du, node, peis, exception, Collections.singleton(c));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue