[Soot-list] Possible bug in PatchingChain.insertBefore(List, Object)

Rhodes H. F. Brown rhodesb at cs.uvic.ca
Wed May 31 15:16:21 EDT 2006


Henry,

The behavior you describe is the correct, intended behavior -- there  
is no bug.

The idea is that if you want to add statements/instructions that  
precede a particular statement (i.e. program point), then those new  
statements should precede the target on *all* possible program paths.  
In other words, any jumps to the target should be redirected to the  
head of the new, preceding statements. If you only want inserted  
statements to precede a target on the fall-through path, then what  
you really want to do is "insertAfter" the target's fall-through  
predecessor.

When you are instrumenting code, it is always important to make it  
clear to yourself, and others, whether you want to add before a  
statement, or after its predecessor(s) -- the distinction is  
important when considering an arbitrary CFG, where any given  
statement may have numerous predecessors.

Cheers,
Rhodes

On 31-May-06, at 10:07 AM, Henry Falconer wrote:

> Hi,
> I'm working on a plugin for the AspectBench Compiler (abc), which  
> depends on Soot and there seems to be a bug in the method  
> PatchingChain.insertBefore(List, Object), or some method it depends  
> on, relating to redirecting branches.
>
> As far as I can tell, all 'if' statements have their targets  
> redirected to the top of the List of Objects to insert, whereas the  
> targets should just be left alone. PatchingChain.insertAfter  
> appears not to be affected.
>
> I hope this isn't a recent fix and that I haven't used any methods  
> incorrectly.
>
> Many thanks,
> Henry Falconer



More information about the Soot-list mailing list