Skip to content

Precedence issue when using typemapped operands in x64 mode #95

@CensoredUsername

Description

@CensoredUsername
struct Test {
    a: u32,
    b: u32
}

dynasm!(ops
    ; mov rbx => Test[2 + 1].b, rax
);

Generates a displacement of 0x15 instead of 0x1C for some reason.

The code it should generate for the displacement is:

0x1C == (::std::mem::size_of<Test> as i32) * (2 + 1) + offset_of(Test, b).

However it generates 0x15, and the only explanation for that is something like:

0x15 == (::std::mem::size_of<Test> as i32) * 2 + 1 + offset_of(Test, b).

Now this shouldn't be happening, as the code generation for all of this does use delimited groups to avoid this. But it is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions