Skip to content

Change panic to assert #127

@Ponmander

Description

@Ponmander

Put file and line number of the panic:

Bytecode* evt_goto_end_case(Evt* script) {
    s32 switchDepth = 1;
    Bytecode* pos = script->ptrNextLine;
    s32* opcode;
    s32* nargs;

    do {
        opcode = pos++;
        nargs = pos++;
        pos += *nargs;

        switch (*opcode) {
            case EVT_OP_END:
                PANIC();
                break;
            case EVT_OP_SWITCH:
                switchDepth++;
                break;
            case EVT_OP_END_SWITCH:
                switchDepth--;
                if (switchDepth == 0) {
                    return opcode;
                }
                break;
        }
    } while (TRUE);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions