[Soot-list] Possible bug in PatchingChain.insertBefore(List,
Object)
Henry Falconer
falconer21 at hotmail.com
Wed May 31 19:54:31 EDT 2006
>The behavior you describe is the correct, intended behavior -- there is no
>bug.
Hi,
thanks for the quick replies. I understand that insertBefore(Chain/List
toInsert, Object point) should redirect jumps referring to 'point' to the
top of 'toInsert', but the behaviour I'm seeing is that *all* jumps in
toInsert, regardless of their targets, are being redirected.
I have an idea that might partially explain this: some of the code I'm
inserting contains jumps to 'point' that I want to keep intact after they're
inserted. For example, say this block of code, 'toInsert', is a while loop
that I've constructed. Before I insert the while loop, I've set the target
of the if statement at the top, which represents the loop condition, to the
same 'point' that I'm passing to insertBefore(), so that it exits properly
when this loop is inserted into the method. insertBefore() now redirects the
if statement's target, so that if the loop condition fails, it just jumps
back to the loop condition again, so you have an infinite loop.
What would you recommend in this case?
Thanks,
Henry
More information about the Soot-list
mailing list