[Soot-list] Add Expression works strange.

Bodden, Eric eric.bodden at sit.fraunhofer.de
Wed Feb 4 03:43:28 EST 2015


Hmmm, this looks wrong. Can you please post a minimal test case to reproduce this?

Cheers,
Eric

> On 04.02.2015, at 08:51, Roman Petriev <vvpiroman at gmail.com> wrote:
> 
> I try to initialize, and after this I have:
> 
> iconst_0
> istore_1
> iinc_w        #1,  1
> 
> So, it isn't help.
> 
> 
> 2015-02-04 2:08 GMT+03:00 Elena Sherman <elenasherman at boisestate.edu>:
> Roman,
> 
> Shouldn't you first initialize intLocal before using it in the addition expression?
> For example to 0 :
> 
> AssignStmt as1 = Jimple.v().newAssignStmt(intLocal, IntConstant.v(0));
> units.add(as1);
> AssignStmt as2 = Jimple.v().newAssignStmt(intLocal, Jimple.v().newAddExpr(intLocal, IntConstant.v(500)));
> units.add(as2);
> 
> On Tue, Feb 3, 2015 at 2:38 PM, Roman Petriev <vvpiroman at gmail.com> wrote:
> Hello everybody!
> I have code:
> 
> Local intLocal = Jimple.v().newLocal("myInt", IntType.v());
> body.getLocals().add(intLocal);
> AssignStmt as2 = Jimple.v().newAssignStmt(intLocal, Jimple.v().newAddExpr(intLocal, IntConstant.v(500)));
> units.add(as2);
> 
> So I want to increase local variable on 500.
> In byte code after transformation I see:
> 
> iinc_w        #5,  1
> 
> Why 1 instead of 500? Where I mistake?
> 
> Thanks for any help.
> 
> Best regards,
> Roman.
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
> 
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

--
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ße 75, 64295 Darmstadt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150204/1ebb3524/attachment.bin 


More information about the Soot-list mailing list