[Soot-list] Add Expression works strange.

Bodden, Eric eric.bodden at sit.fraunhofer.de
Fri Feb 6 07:37:17 EST 2015


--Apple-Mail=_55FDCCE4-672B-4B13-9CAC-0450AE3F5945
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Thanks a lot for the input Elena!

Wow, that's odd! I have never seen javap give such apparently =
false/misleading information. Is this something we should report to =
Oracle?

Anyway, I would assume that the bytecode is actually correct?

Cheers,
Eric


> On 06.02.2015, at 01:22, Elena Sherman <elenasherman at boisestate.edu> =
wrote:
>=20
> Roman,
>=20
> I've run your code with the initialization of the local variable part =
added to it. It looks like that depending on the bytecode viewer I get =
different bytecode. When I use javap -c Decomp.class I get the following =
(what you get):
>=20
> Compiled from "Decomp.java"
> public class decomp.Decomp {
>   public decomp.Decomp();
>     Code:
>        0: aload_0
>        1: invokespecial #1                  // Method =
java/lang/Object."<init>":()V
>        4: return
>        5: iconst_0
>        6: istore_0
>        7: iinc_w        #0,  1              // #0
>=20
>   public static void main(java.lang.String[]);
>     Code:
>        0: return
>        1: iconst_0
>        2: istore_0
>        3: iinc_w        #0,  1              // #0
> }
>=20
> However, when I use Eclipse's bytecode viewer I get the following:
>=20
> // Compiled from Decomp.java (version 1.2 : 46.0, super bit)
> public class decomp.Decomp {
>   // Method descriptor #12 ()V
>   // Stack: 1, Locals: 1
>   public Decomp();
>      0  aload_0 [this]
>      1  invokespecial java.lang.Object() [1]
>      4  return
>      5  wide
>      6  iinc 0 500 [this]
>       Line numbers:
>         [pc: 0, line: 0]
>         [pc: 1, line: 1]
>         [pc: 4, line: 2]
>         [pc: 5, line: 3]
>       Attribute: LineNumberTable Length: 18
>       Attribute: LineNumberTable Length: 18
>=20
>   // Method descriptor #11 ([Ljava/lang/String;)V
>   // Stack: 0, Locals: 1
>   public static void main(java.lang.String[] arg0);
>     0  return
>     1  wide
>     2  iinc 0 500 [arg0]
>       Line numbers:
>         [pc: 0, line: 0]
>         [pc: 1, line: 1]
>       Attribute: LineNumberTable Length: 10
>       Attribute: LineNumberTable Length: 10
> }
>=20
> Which is correct. So, apparently the wide incremental instruction, =
i.e., iinc_w should be interpreted a bit different than its regular =
version iinc. I'm not a bytecode specialist, so I cannot tell exactly =
how to interpret iinc_w's arguments in terms of iinc.
>=20
> In general bytecode can be quite confusing, so in order to check =
whether your instrumentation works as expected try to print something =
out like the value of the local variable you're trying to increment. =
Thus when you execute the instrumented code you will know for sure if =
this is what you want or not, or there are any errors in the =
instrumentation.
>=20
> Hope it helps.
>=20
> Elena
>=20
> On Thu, Feb 5, 2015 at 11:38 AM, Roman Petriev <vvpiroman at gmail.com> =
wrote:
> Test cases here.
> Is it good? Do you need anything else?
>=20
> 2015-02-05 12:58 GMT+03:00 Bodden, Eric =
<eric.bodden at sit.fraunhofer.de>:
> Hi Roman.
>=20
> > I hope that is (exactly) what you want to see.
>=20
> Ideal would be a minimal but runnable example, including your driver =
class for Soot and the command-line options you are using. We should be =
able to reproduce this with as little effort as possible.
>=20
> Thanks,
> Eric
>=20
>=20

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and =
EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 869-127
Room B5.11, Fraunhofer SIT, Rheinstra=C3=9Fe 75, 64295 Darmstadt


--Apple-Mail=_55FDCCE4-672B-4B13-9CAC-0450AE3F5945
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU1K8bAAoJEBflvf1oEO7Re6gP/iGhyx3YchfmPMMQIjNs7vLF
FE76xlv9WgdutlkCA1X8hlfFbje8h0bV8YU0yVuchUOexSyOL2OtAuNZ7RQ3Xp4m
AghUJQFXKpphwbFHWBuezWP4njDsx8PDNF3akDyxtNZ1vLdNUvsDTXFJ6KXzSTr6
rxjdvy95+FdnxVsnKRITlXkUUFKyx39jDEQqq19vthXAFJwtxj1C8oEEIMZHURWq
WqBOHgwL1oZ5c80ElM5ks4Tg9XZm1JfL7fIbROOdgVISKCMRhBO4M+ODTu7HWCZU
meQS8tQiYnyzRyEMB5vwIt4swIuV+xzxiqUQLf8ieLkgFlyZfB2MV9Son6Haf/eC
2w1Z0UrdoEy6+NWnaMuZpPABYRfNua3OHC5/X8StASwR6nHQ6lKr3dKkgji8A5zm
Hq9eMgwyfSWtWxn3GrqPWCDcJjtzA2emF4uv7K88dySRmVgM+InXeIfTof4LGIRd
w6zWX7j8KgVKEqNUoHPvuB6f7RIgaopXr2Qqy5j3mDzg6ualyO2ceaSPK38hROG6
By7r7Z7C+6N7pas7WeeI/Ga162AIvg8mnmkyXqRXUexHQ51YX5VDlljJxN5R5Q3F
z6vzK9sBFNHStvW4iYLCXTQGkmA326tip9fm10Gq8uLdEvOoMF7gYTfxLN18uEnm
aXQCHvBV5s+KeFGnfqI5
=/bMa
-----END PGP SIGNATURE-----

--Apple-Mail=_55FDCCE4-672B-4B13-9CAC-0450AE3F5945--


More information about the Soot-list mailing list