You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And then, SSATransform#rerun calls SSATransform#resetSSAVars and it removes variables' versions, which makes the code incorrect:
Step ConstructorVisitor, after SSATransform#resetSSAVars
0x0010: CONSTRUCTOR (r0) = (...)
0x0020: IPUT (r0)
0x0030: CONST (r0) = (...)
0x0040: APUT (r0, ...)
0x0050: INVOKE (...) = (r0, ...) // info that `r0v0` was used here (not `r0v1`) has been lost
0x0060: CONST (r0) = (...)
0x0070: APUT (r0, ...)
0x0080: INVOKE (...) = (r0, ...) // info that `r0v0` was used here (not `r0v1` or `r0v2`) has been lost
Step ConstructorVisitor, after SSATransform#process
@pubiqq thanks for notice!
So we can't rerun SSA transform after any insns inline, because it messes registers usage.
As I see such rerun used only in one place, so I will try to adjust vars manually without reset.
By the way, can you share a smali code for that method? It will really simplify writing a test case for this issue.
Issue details
This usually happens with a code like this:
After some transformations, the code can take the following form:
Step
ConstructorVisitor
, after visiting methods but beforeSSATransform#rerun
And then,
SSATransform#rerun
callsSSATransform#resetSSAVars
and it removes variables' versions, which makes the code incorrect:Step
ConstructorVisitor
, afterSSATransform#resetSSAVars
Step
ConstructorVisitor
, afterSSATransform#process
Provide sample and class/method full name
smali code
Jadx version
1.5.0
The text was updated successfully, but these errors were encountered: