December 03, 2005
I think I reported this before, but I have a reasonable test case this time.  It has something to do with declaring an asm block volatile (redundant, I know, but I'd prefer it be explicit).


C:\code\d\bugs>type 140_1.d
template atomicStore( T )
{
    void atomicStore( inout T val, T newval )
    {
        volatile asm
        {
            mov EAX, val;
            mov EBX, newval;
            lock;
            xchg [EAX], EBX;
        }
    }
}

void main()
{
    int  i;
    uint u;

    atomicStore!(int)( i, 1 );
    atomicStore!(uint)( u, 2 );
}
C:\code\d\bugs>dmd 140_1.d
Assertion failure: '!v->csym' on line 388 in file 'glue.c'

abnormal program termination

C:\code\d\bugs>
December 04, 2005
Sean Kelly schrieb am 2005-12-03:
> I think I reported this before, but I have a reasonable test case this time.  It has something to do with declaring an asm block volatile (redundant, I know, but I'd prefer it be explicit).
>
>
> C:\code\d\bugs>type 140_1.d
> template atomicStore( T )
> {
>      void atomicStore( inout T val, T newval )
>      {
>          volatile asm
>          {
>              mov EAX, val;
>              mov EBX, newval;
>              lock;
>              xchg [EAX], EBX;
>          }
>      }
> }
>
> void main()
> {
>      int  i;
>      uint u;
>
>      atomicStore!(int)( i, 1 );
>      atomicStore!(uint)( u, 2 );
> }
> C:\code\d\bugs>dmd 140_1.d
> Assertion failure: '!v->csym' on line 388 in file 'glue.c'
>
> abnormal program termination

Added to DStress as http://dstress.kuehne.cn/run/b/bug_glue_387_F.d http://dstress.kuehne.cn/run/b/bug_glue_387_G.d http://dstress.kuehne.cn/run/b/bug_glue_387_H.d

(yes, it is 387 instead of 388 for historic reasons)

Thomas