D - [BUG] -g flag + naked + use members = error
- Robert (18/26) Dec 16 2003 This D codes generates wrong machine codes (for Intel CPU) when -g flag ...
This D codes generates wrong machine codes (for Intel CPU) when -g flag is set. class A { int a; void foo() { a = 1; asm { naked; ret; } } } If -g flag is not set, this codes generates:C7 40 08 01 00 00 00: mov [EAX + 8], 1 <- EAX is `this'void foo { a = 1;C3 : retasm { naked; ret; }However, if -g flag is set:}8B 45 FC : mov EAX, [EBP - 4] <- this code is added C7 40 08 01 00 00 00: mov [EAX + 8], 1void foo { a = 1;C3 : retasm { naked; ret; }The added code means it moves `this' into EAX register, but [EBP - 4] is normally not `this', because `foo' is naked function. Robert (Japanese)}
Dec 16 2003