Bug 5819 – DMD doesn't error/warn about illegal asm for 64bit mode

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2011-04-08T09:27:00Z
Last change time
2015-06-09T05:11:35Z
Assigned to
nobody
Creator
ibuclaw

Comments

Comment #0 by ibuclaw — 2011-04-08T09:27:35Z
64bit DMD will happily compile this and emit a bad executable. void main() { // All the following should be illegal for x86-64 asm { aaa; // illegal aad; // illegal aam; // illegal aas; // illegal daa; // illegal das; // illegal into; // illegal pop DS; // illegal pop ES; // illegal pop SS; // illegal popa; // illegal push CS; // illegal push DS; // illegal push ES; // illegal push SS; // illegal pusha; // illegal pushf; // illegal popf; // illegal // Miscellaneous issue: // DMD silently replaces EAX with RAX, etc, etc. // Should really be an error. pop EAX; // can't have 32-bit stack operands in 64bit mode push EAX; // can't have 32-bit stack operands in 64bit mode } } Regards
Comment #1 by bugzilla — 2011-06-04T16:54:56Z