[Soot-list] Block instrumentation @param-assignment Exception

hesam ghafouri hsmghfr at yahoo.com
Wed Sep 28 15:10:40 EDT 2016


Hi all,
I am using Soot to instrument Java classes. I am using the InvokeStaticInstrumenter example. However, I am going to instrument the blocks instead of statements. So I am using the following instruction:
BlockGraph blockGraph = new ExceptionalBlockGraph(body);
        for (Block block : blockGraph.getBlocks()) 
        {
            block.insertAfter(Jimple.v().newInvokeStmt(Jimple.v().newStaticInvokeExpr(
                    increaseCounter.makeRef(), IntConstant.v(1))), block.getHead());
        }
But I get the following exception:
Exception in thread "main" java.lang.RuntimeException: @param-assignment statements should precede all non-identity statements
    at soot.jimple.JimpleBody.validateIdentityStatements(JimpleBody.java:101)
    at soot.jimple.JimpleBody.validate(JimpleBody.java:67)
    at soot.Printer.printTo(Printer.java:322)
    at soot.Printer.printTo(Printer.java:221)
    at soot.PackManager.writeClass(PackManager.java:896)
    at soot.PackManager.writeOutput(PackManager.java:475)
    at soot.PackManager.writeOutput(PackManager.java:400)
    at soot.Main.run(Main.java:199)
    at soot.Main.main(Main.java:141)
    at Main.main(Main.java:62)
Could any one help or had the same issue?
Thanks


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20160928/1d2d2ee7/attachment.html 


More information about the Soot-list mailing list