[Soot-list] Counting exits in a loop - understanding Jimple "goto [?= nop]"

John Dean jdean4 at kc.rr.com
Mon Jul 16 22:27:46 EDT 2012


Phil,
You say "When you operating at runtime, the targets of the goto instructions
will be two disctinct Units." So for the "goto nop" that shows up in my list
of statements, what are the "targets," that are "two distinct Units"?
Likewise, for the "goto [?= nop]" statement: What are the "targets," that
are "two distinct Units"?

Pardon my ignorance - I'm obviously not grasping something significant about
goto statements.

Thanks,
John

-----Original Message-----
From: phil.pratt.szeliga at gmail.com [mailto:phil.pratt.szeliga at gmail.com] On
Behalf Of Phil Pratt-Szeliga
Sent: Monday, July 16, 2012 6:12 PM
To: john.dean at park.edu
Cc: soot-list at sable.mcgill.ca
Subject: Re: [Soot-list] Counting exits in a loop - understanding Jimple
"goto [?= nop]"

Hi John,

> 1. I thought goto statements normally cause execution to jump to an 
> address, such that the address is sometimes represented by a label. 
> But what do "goto nop" and "goto [?= nop]" jump to? If nop is a label 
> (and I doubt that's the case), then isn't it a problem that there are 
> more than one statement
> (label?) with the nop label?

nop is an instruction. When you operating at runtime, the targets of the
goto instructions will be two disctinct Units. When jimple is written out to
disk, they place unique labels in the file.

> 2. Any advice on Jimple documentation that might help me to understand 
> things better?

Feel free to email the list with questions as they come up. I have a bunch
of experience with Jimple.

Some important classes/interfaces
Unit
Value
Stmt
Expr

Each line of code is a Unit. The individual parts of Units are usually
Values or Units. You can go here [1] and lookup those classes/interfaces and
see the hierarchy of classes to get a better understanding of how things
work.

Phil Pratt-Szeliga
Syracuse University

[1] http://www.sable.mcgill.ca/soot/doc/



More information about the Soot-list mailing list