[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Soot 1.2.2 - How Do I construct a new instance



On Fri, 24 Aug 2001, nathan gulley wrote:

> Since an AssignStmt  may not precede the identityStmt's at the
> beginning of the method, I tried adding the new AssignStmt to the end of
> the method
> using the call sequence:
>
>      units.insertBefore(stmt , units.getLast());

I suggest instantiating an iterator on the units:

	Iterator it = units.snapshotIterator();
	Stmt t = null;
        while (it.hasNext())
	{
		t = (Stmt) it.next();
		if (!(t instanceof IdentityStmt))
			break;
	}

	units.insertBefore(t, stmt);

> java.lang.reflect.InvocationTargetException: java.lang.VerifyError:
> (class: test
> /LoadMe, method: foo signature: (Ljava/lang/String;)V) Expecting to find
> object/
> array on stack
>         at java.lang.Class.newInstance0(Native Method)
>         at java.lang.Class.newInstance(Class.java:237)
>         at test.TestClient.test15(TestClient.java:1009)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at test.TestClient.main(TestClient.java:43)

I have no idea what's going on here, but if you mailed me the resulting
Jimple file, I would most likely be able to tell what the problem is with
the Jimple you created.  Jimple is nice that way: it's easily readable.

pat