www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 650] New: Assertion failure: '0' on line 774 in file 'expression.c'

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=650

           Summary: Assertion failure: '0' on line 774 in file
                    'expression.c'
           Product: D
           Version: 0.176
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: kinaba is.s.u-tokyo.ac.jp


Feeding arrayliteral of chars (not string literals)
as a template argument causes abnormal termination of dmd.

  // credit goes to http://pc8.2ch.net/test/read.cgi/tech/1158013550/535
  template test(char[] val) {}
  mixin test!(['a','b','c']); // if this is "abc" it's ok.

outputs:

  global.errors = 0, gag = 0
  01E27330 arrayliteral type=char[3]
  Assertion failure: '0' on line 774 in file 'expression.c'

  abnormal program termination

The same assertion failure also happens when
a pointer (to functions, global variables, etc) is
put into a tuple parameter:

  // discovered by shinichiro.h
  template T(X...) {}
  void f(){}
  alias T!(&f) a;

  global.errors = 0, gag = 0
  01E56F10 symoff type=void(*)()
  Assertion failure: '0' on line 774 in file 'expression.c'

  abnormal program termination


-- 
Dec 05 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-12-05:
 http://d.puremagic.com/issues/show_bug.cgi?id=650
 Feeding arrayliteral of chars (not string literals)
 as a template argument causes abnormal termination of dmd.

   // credit goes to http://pc8.2ch.net/test/read.cgi/tech/1158013550/535
   template test(char[] val) {}
   mixin test!(['a','b','c']); // if this is "abc" it's ok.

 outputs:

   global.errors = 0, gag = 0
   01E27330 arrayliteral type=char[3]
   Assertion failure: '0' on line 774 in file 'expression.c'

   abnormal program termination
Added to DStress as http://dstress.kuehne.cn/compile/t/template_50_A.d http://dstress.kuehne.cn/compile/t/template_50_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFd/yKLK5blCcjpWoRAk/9AJ9sGY+NvRH6gnE98Sh2rHItF5wehACdEUv4 ZhNcaKNF+QvBs8ffdX41/ss= =paZ8 -----END PGP SIGNATURE-----
Dec 07 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=650


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed DMD 0.178


-- 
Dec 27 2006