[Soot-list] Dependency Injection - from annotation to static field reference

Eric Bodden eric.bodden at ec-spride.de
Fri Feb 15 03:56:41 EST 2013


Hello.

So you are saying that the points-to sets of $r1 and
SimpleServletEchoCases.serviceEndpoint don't intersect?

Just to make sure... you _are_ executing the points-to analysis after
your modifications, aren't you?

Eric

On 15 February 2013 01:37, Marc-Andre Laverdiere-Papineau
<marc-andre.laverdiere-papineau at polymtl.ca> wrote:
> Hello,
>
> I am working on a code transformation that is currently not working. My
> code is supposed to transform a reference to a Web Service endpoint to a
> static reference generated a priori.
>
> However, Spark (with default options) is not connecting the dots
> properly, so I have a missing edge in the call graph. I also
> double-checked the points-to-sets and there is no intersection between
> the static field's and the local variable's.
>
> There is the small chunk of code that shows the transformation:
>
> AssignStmt newStmt = Jimple.v().newAssignStmt(assigned,
> Jimple.v().newStaticFieldRef(targetField.makeRef()));
> substitutions.add(new Pair<Unit, Unit>(u, newStmt));
> ...
> for (Pair<Unit, Unit> p : substitutions) {
>    units.swapWith(p.getO1(), p.getO2());
> }
>
> The generated Jimple looks like this (I simplified the types for
> readability):
> public void <init>()
>      {
>          SimpleServletEchoCases r0;
>          EchoServiceImplService $r1;
>          IEchoService $r2;
>
>          r0 := @this: SimpleServletEchoCases;
>          specialinvoke r0.<java.lang.Object: void <init>()>();
>          $r1 = <SimpleServletEchoCases: EchoServiceImplService
> serviceEndpoint>;
>          $r2 = <WSCaller: EchoServiceImpl wsEchoServiceImpl>;
>          <SimpleServletEchoCases: IEchoService service> = $r2;
>          return;
>      }
>
> I probably did something silly - can anyone spot the mistake?
>
> --
> Marc-André Laverdière-Papineau
> Doctorant - PhD Candidate
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



-- 
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list