[Soot-list] PatchingChain.insertBefore(Chain<E> toInsert, E point): bug?

Patrick Lam plam at cs.mcgill.ca
Sun Dec 13 12:15:15 EST 2009


Khilan Gudka wrote:
> > Hi,
> >
> > Sorry, my description of the problem was incorrect. All jumps to "point"
> > from any unit in the chain are redirected to the first unit in the
chain.

Hi Khilan,

Eric and I just talked about this. It seems to me that the current
behaviour is unexpected in your particular example, but not all
examples. For instance, consider the case where you're inserting the
following sequence:

  i = i + 1;
  goto label3;
  if (cond) goto label1;

label1:
  ...

That is, we have a loop. In that case, the semantics you'd expect for
insertBefore---change all references to label1 to the newly-inserted
statement---do make sense.

I agree that the expected behaviour is not totally clear, but I'm not
sure that fixing it would lead to more predictable behaviour. Perhaps
you should just manually adjust the target afterwards?

pat



More information about the Soot-list mailing list