Skip to content

jit: Incomplete muldivmod #297

@jserv

Description

@jserv

Function muldivmod in src/jit_x64.c is incomplete:

    /* Short circuit for imm == 0 */
    if (!reg && imm == 0) {
        assert(NULL);                                                                                                                                         
        if (div || mul) {
            /* For division and multiplication, set result to zero. */
            emit_alu32(state, 0x31, dst, dst);
        } else {
            /* For modulo, set result to dividend. */
            emit_mov(state, dst, dst);
        }
        return;
    }

When imm equals to zero, there is no chance to resume the execution.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions