Skip to content

Inliner propagating casts when propagating argument expressions across inlined region #9

@tiagolascasas

Description

@tiagolascasas

The Inliner generates expressions like this:

*((float *) &edges[num]) = decomp_2_renamed_2_i163;

which should be simplified into just edges[num] = decomp_2_renamed_2_i163

The problem is that the expression should have never been generated with that nonsensical (float *) cast (which is, perhaps unsurprisingly, valid C). This is because of the propagation of argument expressions into parameter references, which is done every time a function is inlined. The fix would simply have us remove the cast from the expression, turning it into *(&edges[num]), which the inliner is already capable of simplifying into edges[num] at a later pass.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions