[Soot-list] Transform of call sites

Hal Hildebrand hal.hildebrand at gmail.com
Mon Jul 26 11:48:03 EDT 2010


Yes, sorry about that.  I was showing only one branch for simplicity.  The real code has an if of the form:

	if (stmt instanceof InvokeExpr) {
		...
	} else  if (stmt.containsInvokeExpr()) {
		...
	}

My hope is that this should be sufficient...

On Jul 26, 2010, at 8:15 AM, Eric Bodden wrote:

> There seems to be a mistake...
>>        Iterator stmtIt = body.getUnits().snapshotIterator();
>>        while (stmtIt.hasNext()) {
>>            Stmt stmt = (Stmt) stmtIt.next();
>>            if (stmt.containsInvokeExpr()) {
>>                ValueBox invocation = stmt.getInvokeExprBox();
>>                InvokeExpr expr = (InvokeExpr) invocation.getValue();
>>                Local synthesized = newLocal(UUID.randomUUID().toString(), expr.getType(), body);
>>                Unit invocationUnit = Jimple.v().newAssignStmt(synthesized, expr);
>>                units.insertBefore(stmt, invocationUnit);
>>                invocation.setValue(synthesized);
> Here you are exchanging the invoke expression by a local. That cannot
> work if "stmt" is a simple InvokeStmt because then you "invoke" a
> local vatiable, which makes no sense.
>>            }
>>        }
> 
> Eric



More information about the Soot-list mailing list