The following code: uint func() { asm { naked; inc [EAX]; inc byte ptr [EAX]; inc short ptr [EAX]; inc int ptr [EAX]; inc long ptr [EAX]; } } generates: __D5test24funcFZk: inc byte ptr [EAX] inc byte ptr [EAX] inc word ptr [EAX] inc dword ptr [EAX] inc byte ptr [EAX] <== !!!!! The last instruction should be rejected by the compiler.
@WalterBright created dlang/dmd pull request #11601 "fix Issue 21181 - Inline Assembler compiles long ptr as a byte operati…" fixing this issue: - fix Issue 21181 - Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles https://github.com/dlang/dmd/pull/11601
dlang/dmd pull request #11601 "fix Issue 21181 - Inline Assembler compiles long ptr as a byte operati…" was merged into master: - 4495f6f66dd36e3547c47a464f4393c26f7f4afc by Walter Bright: fix Issue 21181 - Inline Assmbler compiles long ptr as a byte operation for 32 bit compiles https://github.com/dlang/dmd/pull/11601