Package sootup.interceptors
Class LocalSplitter
java.lang.Object
sootup.interceptors.LocalSplitter
- All Implemented Interfaces:
BodyInterceptor
A BodyInterceptor that attempts to identify and separate uses of a local variable (definition)
that are independent of each other. This is necessary as the AsmMethodSource maps usages of the
same Local index to the same Local object, which can lead to wrong Jimple e.g. when a primitive
type gets merged with a reference-type and augmenting the type of the Local is less precise.
For example the code:
l0 := @this Test l1 = 0 l2 = 1 l1 = l1 + 1 l2 = l2 + 1 return
to:
l0 := @this Test l1#0 = 0 l2#0 = 1 l1#1 = l1#0 + 1 l2#1 = l2#0 + 1 return
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
interceptBody
(Body.BodyBuilder builder, View view) Takes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.
-
Constructor Details
-
LocalSplitter
public LocalSplitter()
-
-
Method Details
-
interceptBody
Description copied from interface:BodyInterceptor
Takes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.- Specified by:
interceptBody
in interfaceBodyInterceptor
-