matt-kempster / m2c

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

Fix negative values for hex cases #248

Closed AngheloAlf closed 1 year ago

AngheloAlf commented 1 year ago

Negative hex cases produce an invalid value like this:

        switch (temp_v1) {                          /* switch 3; irregular */
            case 0x-1:                              /* switch 3 */

With this fix a proper negative value is emitted:

        switch (temp_v1) {                          /* switch 3; irregular */
            case -0x1:                              /* switch 3 */