Bug 4926 – ICE: PREC_zero assertion failure due to unset precedence

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-09-23T13:54:00Z
Last change time
2015-06-09T05:11:36Z
Keywords
patch
Assigned to
nobody
Creator
rsinfu

Attachments

IDFilenameSummaryContent-TypeSize
767exp-precedences.patchPatch against dmd r685, sets missing precedencestext/plain3186

Comments

Comment #0 by rsinfu — 2010-09-23T13:54:58Z
Created attachment 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.
Comment #1 by rsinfu — 2010-09-23T14:01:53Z
*** Issue 4912 has been marked as a duplicate of this issue. ***
Comment #2 by clugdbug — 2010-09-23T23:57:00Z
This is a regression introduced in 2.049, and it also applies to D1 (need to replace 'enum' with 'const' for the D1 test case).
Comment #3 by juanjux — 2010-09-27T13:25:54Z
*** Issue 4950 has been marked as a duplicate of this issue. ***
Comment #4 by bugzilla — 2010-09-27T17:42:32Z
Comment #5 by clugdbug — 2010-10-07T07:25:11Z
*** Issue 4981 has been marked as a duplicate of this issue. ***
Comment #6 by clugdbug — 2010-10-07T07:26:31Z
*** Issue 4914 has been marked as a duplicate of this issue. ***
Comment #7 by clugdbug — 2010-10-20T11:55:39Z
*** Issue 5087 has been marked as a duplicate of this issue. ***