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.
Comment #1 by dlang-bot — 2020-08-21T07:57:36Z
@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
Comment #2 by dlang-bot — 2020-08-24T03:16:09Z
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