[Soot-list] Some changes

Eric Bodden eric.bodden at ec-spride.de
Sat Dec 17 09:54:43 EST 2011


Hello.

Thanks for the patch but could you be a bit more specific? What
problem is this supposed to solve?

Cheers,
Eric

On 17 December 2011 08:12, Rule One <rule1_ at hotmail.com> wrote:
> 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!
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list