[Soot-list] verification error on accessing fields

Paris Yiapanis yiapanip at cs.man.ac.uk
Wed Jun 23 11:51:37 EDT 2010


Hi Eric,

First of all thank you very much for your quick response. It is highly
appreciated.

The package name is my mistake now while copying, but it is actually the
same in my code.

I have tried the '-validate' option as you suggested but it didn't show
anything.

The TempClass looks like:

public class TempClass {
    public int[] a = new int[10];
    public int[] b = new int[10];

    public TempClass(){
           initializeArrayA();
    }

        public void m(){

           for(int i= 0; i < a.length; i++){
               b[i] = a[i];
           }

    }
}

In my code I am generating from scratch a class myClass that gets a hold of
the 'this' reference of TempClass and accesses its fields.

Now I had another issue that I do not know to what extend may be causing the
problem (and I hope I don't confuse the things):

Inside myClass class as you can see from my Jimple earlier, I am accessing
an instance field 'objRef'.
However, objRef field is not declared inside myClass. It is declared in
another class called 'AbstractClass' which myClass extends.
So, while producing jimple I couldn't say: myClass.getFieldByName('objRef').
It was complaining that 'myClass' doesn't have such a field.
Thus I had to use the superclass to access that field:
myClass.getSuperclass().getFieldByName('objRef').

I didn't mention that in my jimple code above to keep things simpler, but
the jimple statement is actually:
r1 = r0.<myPackage.*AbstractClass*: java.lang.Object objRef>;

rather than:

r1 = r0.<myPackage.*MyClass*: java.lang.Object objRef>;

In reality I should have been able to use MyClass.objRef, isn't it?
I don't know if this contributes to my verification problem  later.
I hope I didn't make things more confusing.

Thank you in advance,

Paris

On Wed, Jun 23, 2010 at 4:14 PM, Eric Bodden <
bodden at st.informatik.tu-darmstadt.de> wrote:

> By the way: why are you using different package names?
>
> testLoops2.TempClass in the cast but myPackage.TempClass in the field
> access.... may that be the mistake?
>
> Eric
>
> --
> Dr. Eric Bodden
> Software Technology Group, Technische Universität Darmstadt, Germany
> Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
> Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt
>
>
>
> On 23 June 2010 17:13, Eric Bodden <bodden at st.informatik.tu-darmstadt.de>
> wrote:
> >> Does anyone know any way around this problem, as I do not want to
> disable
> >> verification?
> >
> > Hmm, I don't see anything wrong. It may help to see the code of
> > TempClass... You may try the -validate switch to Soot. That will do
> > some validation on your Jimple code.
> >
> > Eric
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20100623/400b8747/attachment.html 


More information about the Soot-list mailing list