[Soot-list] Some changes
Rule One
rule1_ at hotmail.com
Sat Dec 17 02:12:12 EST 2011
I was having difficulties loading some classes using Soot, here are the changes I made to the source code (could someone verify if these are correct? I have absolutely no experience in Soot):
Index: src/soot/jimple/toolkits/typing/fast/AugEvalFunction.java===================================================================--- src/soot/jimple/toolkits/typing/fast/AugEvalFunction.java (revision 3600)+++ src/soot/jimple/toolkits/typing/fast/AugEvalFunction.java (working copy)@@ -172,10 +172,10 @@ if ( at instanceof ArrayType ) return ((ArrayType)at).getElementType();- else if ( at instanceof BottomType || at instanceof NullType )+ else if ( at instanceof BottomType || at instanceof NullType || at instanceof RefType ) return BottomType.v(); else throw new RuntimeException(- "Base of array reference is not an array!");+ "Base of array reference is not an array! "+at); } else if ( expr instanceof NewArrayExpr ) return ((NewArrayExpr)expr).getBaseType().makeArrayType();@@ -225,4 +225,4 @@ return RefType.v("java.lang.Class"); else throw new RuntimeException("Unhandled expression: " + expr); }-}\ No newline at end of file+}Index: src/soot/jimple/toolkits/typing/integer/ConstraintChecker.java===================================================================--- src/soot/jimple/toolkits/typing/integer/ConstraintChecker.java (revision 3600)+++ src/soot/jimple/toolkits/typing/integer/ConstraintChecker.java (working copy)@@ -227,15 +227,16 @@ Type baset = ((Local) ref.getBase()).getType(); if(!(baset instanceof NullType)) {- ArrayType base = (ArrayType) baset; Value index = ref.getIndex();- - if((base.numDimensions == 1) &&- (base.baseType instanceof IntegerType))- {- left = ClassHierarchy.v().typeNode(base.baseType);- }- + if(baset instanceof ArrayType)+ {+ ArrayType base = (ArrayType) baset;+ if((base.numDimensions == 1) &&+ (base.baseType instanceof IntegerType))+ {+ left = ClassHierarchy.v().typeNode(base.baseType);+ }+ } if(index instanceof Local) { if(!ClassHierarchy.v().typeNode(((Local) index).getType()).hasAncestor_1(ClassHierarchy.v().INT))@@ -290,15 +291,17 @@ Type baset = ((Local) ref.getBase()).getType(); if(!(baset instanceof NullType)) {- ArrayType base = (ArrayType) baset; Value index = ref.getIndex();+ if(baset instanceof ArrayType)+ {+ ArrayType base = (ArrayType) baset;+ if((base.numDimensions == 1) &&+ (base.baseType instanceof IntegerType))+ {+ right = ClassHierarchy.v().typeNode(base.baseType);+ }+ } - if((base.numDimensions == 1) &&- (base.baseType instanceof IntegerType))- {- right = ClassHierarchy.v().typeNode(base.baseType);- }- if(index instanceof Local) { if(!ClassHierarchy.v().typeNode(((Local) index).getType()).hasAncestor_1(ClassHierarchy.v().INT))Index: src/soot/jimple/toolkits/typing/integer/ConstraintCollector.java===================================================================--- src/soot/jimple/toolkits/typing/integer/ConstraintCollector.java (revision 3600)+++ src/soot/jimple/toolkits/typing/integer/ConstraintCollector.java (working copy)@@ -168,15 +168,18 @@ Type baset = ((Local) ref.getBase()).getType(); if(!(baset instanceof NullType)) {- ArrayType base = (ArrayType) baset; Value index = ref.getIndex(); if(uses) {- if((base.numDimensions == 1) &&- (base.baseType instanceof IntegerType))+ if(baset instanceof ArrayType) {- left = resolver.typeVariable(base.baseType);+ ArrayType base = (ArrayType) baset;+ if((base.numDimensions == 1) &&+ (base.baseType instanceof IntegerType))+ {+ left = resolver.typeVariable(base.baseType);+ } } if(index instanceof Local)@@ -234,15 +237,17 @@ Type baset = ((Local) ref.getBase()).getType(); if(!(baset instanceof NullType)) {- ArrayType base = (ArrayType) baset; Value index = ref.getIndex();+ if(baset instanceof ArrayType)+ {+ ArrayType base = (ArrayType) baset;+ if((base.numDimensions == 1) &&+ (base.baseType instanceof IntegerType))+ {+ right = resolver.typeVariable(base.baseType);+ }+ } - if((base.numDimensions == 1) &&- (base.baseType instanceof IntegerType))- {- right = resolver.typeVariable(base.baseType);- }- if(uses) { if(index instanceof Local)
P.S. THANK YOU VERY MUCH FOR AN EXCELLENT PRODUCT (especially one of this quality that is open source!), Kudos!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20111217/6fac235a/attachment.html
More information about the Soot-list
mailing list