June 21, 2006
The following code crashes the compiler (DMD 0.160 and 0.161)

#const int CONST_OFFSET = 10;
#
#void main()
#{
#	asm
#	{
#		mov EDI, 10;
#		mov EAX, [EDI + CONST_OFFSET];
#	}
#}

It's the use of the const as an offset that causes the crash. Remove the '+ CONST_OFFSET' and it works ok.

This code works in DMD 0.158. Not sure about 0.159 (I don't have 0.159 and I
need to go to sleep now:) )







June 29, 2006
pmoore schrieb am 2006-06-21:
> The following code crashes the compiler (DMD 0.160 and 0.161)
>
> #const int CONST_OFFSET = 10;
> #
> #void main()
> #{
> #	asm
> #	{
> #		mov EDI, 10;
> #		mov EAX, [EDI + CONST_OFFSET];
> #	}
> #}
>
> It's the use of the const as an offset that causes the crash. Remove the '+ CONST_OFFSET' and it works ok.
>
> This code works in DMD 0.158. Not sure about 0.159 (I don't have 0.159 and I
> need to go to sleep now:) )

Added to DStress as http://dstress.kuehne.cn/compile/a/asm_offset_02_A.d http://dstress.kuehne.cn/compile/a/asm_offset_02_B.d

Thomas