Skip to content

[Bug]: Fix BodyInterceptor: Dead Assignment Eliminator #1034

@sahilagichani14

Description

@sahilagichani14

What happened?

doesn't remove the dead assignments. For example: x = 10; is a dead assignment, as well as x = 20; since they are reassigned to new values or not used after that statement.
int tc6_1(int temp) { int x = 10; x = 30; temp = x; if (temp > 5) { x = someMethod(); } x = 20; return temp; }

current Output:
'this := @this: sootUp.RQ1.jb_dae.JB_DAE;
temp := @parameter0: int;
x = 10;
x = 30;
temp = x;

if temp <= 5 goto label1;
x = virtualinvoke this.<sootUp.RQ1.jb_dae.JB_DAE: int someMethod()>();

label1:
x = 20;

return temp;'

Expected Output:
`this := @this: sootUp.RQ1.jb_dae.JB_DAE;
temp := @parameter0: int;
x = 30;
temp = x;

if temp <= 5 goto label1;
x = virtualinvoke this.<sootUp.RQ1.jb_dae.JB_DAE: int someMethod()>();

label1:
return temp;`

Version

Latest develop branch

Relevant log output

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions