matt-kempster / m2c

A MIPS and PowerPC decompiler.
GNU General Public License v3.0
386 stars 46 forks source link

Fix ppc store update instructions #263

Closed SeekyCt closed 10 months ago

SeekyCt commented 10 months ago

Currently, indexed store update instructions give an error along the lines of

        // Error: Expected instruction argument to be of the form offset($register), but found $r3
        // At instruction: stwux $r9, $r3, $r5

due to the call of a.memory_ref in the eval_fn (which is only valid for the non-indexed versions).

This PR fixes this by splitting out the eval_fn into separate ones for the indexed and non-indexed versions like load update instructions do

One thing that's worth noting is that none of the current tests contain any of these instructions, and #187 doesn't actually list them; Super Paper Mario has some functions using the instructions if that helps (possibly means that only later CW versions actually emitted them)

simonlindholm commented 10 months ago

Makes sense. Thanks! The note about Super Paper Mario is useful, sounds like we should use that for project tests if m2c works picks up more again in the future.