Skip to content

Commit 444d261

Browse files
committed
fix Issue 21424 from dmd
1 parent c3ad14f commit 444d261

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

dm/src/dmc/cgelem.d

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,21 @@ private elem *fixconvop(elem *e)
424424
const cop = e.EV.E1.Eoper; /* the conversion operator */
425425
assert(cop <= CNVOPMAX);
426426

427-
if (e.EV.E1.EV.E1.Eoper == OPcomma)
428-
{ /* conv(a,b) op= e2
429-
* =>
430-
* a, (conv(b) op= e2)
427+
elem *econv = e.EV.E1;
428+
while (OTconv(econv.Eoper))
429+
{
430+
if (econv.EV.E1.Eoper != OPcomma)
431+
{
432+
econv = econv.EV.E1;
433+
continue;
434+
}
435+
/* conv(a,b) op= e2 or conv(conv(a,b)) op= e2
436+
* => many: =>
437+
* a, (conv(b) op= e2) a, (conv(conv(b)) op= e2)
431438
*/
432-
elem *ecomma = e.EV.E1.EV.E1;
433-
e.EV.E1.EV.E1 = ecomma.EV.E2;
434-
e.EV.E1.EV.E1.Ety = ecomma.Ety;
439+
elem *ecomma = econv.EV.E1;
440+
econv.EV.E1 = ecomma.EV.E2;
441+
econv.EV.E1.Ety = ecomma.Ety;
435442
ecomma.EV.E2 = e;
436443
ecomma.Ety = e.Ety;
437444
//printf("fixconvop comma\n");

0 commit comments

Comments
 (0)