From: Sven R. <rei...@ma...> - 2003-01-04 02:31:39
|
On Mon, 30 Dec 2002, Andre Baresel wrote: > I just played arround with SplitTemp and found that bug: > Performing the action on the following code will result in wrong code > --------------- > { > int a = 0; > if (b==0) a=2; > b = a; > } > > > ------- > Result: > > { > int NEWNAME = 0; > if (b==0) int a=2; > b = a; > } > > <snip> > Correct Result: > > { > int NEWNAME = 0; > int a=2 > if (b==0) ; > b = a; > } > > > -- Andre > The split temp refactoring is just a prototype, handling the easiest case. IMO, the correct result would be not to split at all. However, I think it is not completely trivial to decide if the variable is still used afterwards (need to check for returns or breaks/continues in the subscope). The case above should be added to the test base, and marked as failure. Sven. Sven Reichard Dept. of Math. Sci. University of Delaware rei...@ma... |