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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich Stmts can enter an exception handler. -
Constructor Summary
ConstructorsConstructorDescriptionSplits locals following the Java semantics: seeLocalSplitter.ExceptionalFlow.VIRTUAL_MACHINE_ERRORS.LocalSplitter(@NonNull LocalSplitter.ExceptionalFlow exceptionalFlow) -
Method Summary
Modifier and TypeMethodDescriptionvoidinterceptBody(@NonNull Body.BodyBuilder builder, @NonNull View view) Takes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.
-
Constructor Details
-
LocalSplitter
public LocalSplitter()Splits locals following the Java semantics: seeLocalSplitter.ExceptionalFlow.VIRTUAL_MACHINE_ERRORS. -
LocalSplitter
-
-
Method Details
-
interceptBody
Description copied from interface:BodyInterceptorTakes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.- Specified by:
interceptBodyin interfaceBodyInterceptor
-