[Soot-list] Extract the method return value

Eric Bodden eric.bodden at ec-spride.de
Tue Apr 24 02:43:06 EDT 2012


Hi.

> Soot says that $r1 is of type java.lang.String, but I get an exception when
> I try to cast either leftOp or rightOp to StringConstant. Is there another
> way to do this?

$r1 is a local variable of type String, but it is not a constant of
type String. The value will, of course, only be assigned at runtime.
Hence, there's no easy way to get this value. You could use a String
analysis, which can be quite expensive, though.
http://www.brics.dk/Xact/doc/dk/brics/xact/analysis/soot/StringConstantAnalysis.html

Eric


More information about the Soot-list mailing list