darknesswind / NutCracker

fork from DamianXVI's squirrel decompiler
20 stars 9 forks source link

missing break; causes assertion #23

Open AdamMil opened 5 years ago

AdamMil commented 5 years ago

The OP_NEWOBJ opcode is missing a break statement in the switch:

case NOT_CLASS:
{
    ExpressionPtr attributes;
    ExpressionPtr baseClass;

    if (arg1 != -1)
        baseClass = state.GetVar(arg1);

    if (arg2 != 0xff)
        attributes = state.GetVar(arg2);

    state.SetVar(arg0, ExpressionPtr(new NewClassExpression(baseClass, attributes)));
    // MISSING BREAK HERE!
}
default:
    assert(0);
    break;

This causes a crash when it falls into the assert(0).