[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifying CFG



On Fri, Jun 18, 2004 at 09:38:49AM +0200, Marco Bakera wrote:
> Hello,
> >
> > The UnitGraph is designed to be immutable. If you need to insert a Unit,
> > the normal way is to insert it into the Chain of Units.
> >
> I tried this, but it didnt work correctly in the case the unit is a target
> of a goto. If I would insert the unit before that target the unit is never
> reached - unless there is another jump targeting to this. So is there a
> comfortable way to make the new inserted unit a target of the jump to the
> old unit?

When you insert before the target of a goto, the PatchingChain updates
the goto to point to the newly-inserted statement. If you don't want
this behaviour, use the getNonPatchingChain() method to get the
underlying Chain which doesn't update anything.

Ondrej

> 
> Thanks for help,
> Marco.
> 
> 
> 
> --
> /X\arco                              ICQ#59397823
>               . .
> ---------oOOo-(_)-oOOo--------> www.bakera.de <--
>