[Soot-list] Why "Unit" as target of JGotoStmt?
Patrick Lam
plam at sable.mcgill.ca
Wed Nov 16 23:05:36 EST 2011
On 11/15/2011 12:03 AM, Eric Bodden wrote:
> Hi all.
>
> A user just asked me why the target of a JGotoStmt is actually a unit,
> not a Stmt. Good question, I thought. Does anybody know? To my
> understanding, a JGotoStmt should always point to a Jimple unit, and
> hence a Stmt.
>
> Am I missing something?
There's some inconsistencies in the API, but there are a number of
getTarget() and getTargetBox() and setTarget() methods sprinked
throughout both Jimple and Baf. Most of the time, all of these methods
return Units (although IfStmt's getTarget() method returns a Stmt). But
we certainly have a UnitBox and not a StmtBox class, so that
getTargetBox() is always going to return a UnitBox. In that sense, it
may make sense for getTarget() to also return a Unit.
pat
More information about the Soot-list
mailing list