Thread overview
[Issue 650] New: Assertion failure: '0' on line 774 in file 'expression.c'
Dec 05, 2006
d-bugmail
Dec 07, 2006
Thomas Kuehne
Dec 27, 2006
d-bugmail
December 05, 2006
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


-- 

December 07, 2006
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


December 27, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=650


bugzilla@digitalmars.com changed:

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




------- Comment #2 from bugzilla@digitalmars.com  2006-12-27 02:00 -------
Fixed DMD 0.178


--