[Issue 4926] New: ICE: PREC_zero assertion failure due to unset precedence

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 23 13:55:39 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4926

           Summary: ICE: PREC_zero assertion failure due to unset
                    precedence
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rsinfu at gmail.com


--- Comment #0 from Shin Fujishiro <rsinfu at gmail.com> 2010-09-23 13:54:58 PDT ---
Created an attachment (id=767)
Patch against dmd r685, sets missing precedences

Precedences for the following TOKs are not set, while they can be referenced by
expToCBuffer().

 TOKassocarrayliteral, TOKcomplex80, TOKdelegate, TOKdotexp,
 TOKdottype, TOKdsymbol, TOKfile, TOKhalt, TOKline,
 TOKnewanonclass, TOKoverloadset, TOKremove, TOKtemplate.

This causes PREC_zero assertion failures in expToCBuffer(). The following cases
all trigger the assertion failure.
--------------------
template Q(s...) { alias s q; }
class C {}
enum assocarrayliteral = Q!( [1:2] ).q.stringof;
enum complex80 = Q!( 1+1.0i ).q.stringof;
enum dottype = Q!( C.Object.toString ).q.stringof;
enum halt = (assert(0), 0).stringof;    // ICE w/ -release
enum remove = Q!( [1:2].remove(1) ).q.stringof;
enum templat = Q!( Q ).q.stringof;
--------------------
The halt case depends on bug 4925. dottype and remove are ice-on-invalid.

Although I couldn't find any offending case for the other TOKs, I think it's
better to define reasonable precedences for all the said TOKs.

The attached patch also fixes bug 4912 and bug 4914.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list