Thread overview
[Bug 307] internal compiler error: Segmentation fault
Sep 04, 2018
Iain Buclaw
Sep 04, 2018
Iain Buclaw
Sep 04, 2018
Iain Buclaw
Sep 04, 2018
Iain Buclaw
September 04, 2018
https://bugzilla.gdcproject.org/show_bug.cgi?id=307

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|Normal                      |High

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Reproducible on stable/2.076 also.

-- 
You are receiving this mail because:
You are watching all bug changes.
September 04, 2018
https://bugzilla.gdcproject.org/show_bug.cgi?id=307

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Reduced and pasted here (gists may have a habit of disappearing).

---
void crash()
{
    applyConfiguration(42);
}

void applyConfiguration(Things...)(Things things)
{
thingloop:
    foreach (i; things)
    {
        switch (i)
        {
            continue thingloop;

            default:
        }
    }
}
---

Problem is triggered by unrolled loop statements.

-- 
You are receiving this mail because:
You are watching all bug changes.
September 04, 2018
https://bugzilla.gdcproject.org/show_bug.cgi?id=307

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
More complete test that covers three combinations of problems:

1. Continue label in unrolled loop
2. Break label in unrolled loop
3. Loop body unrolled more than once.

I have something for 1 and 2, but not 3 currently.

---
void test307()
{
    apply307(1, 2, 3);
}

void apply307(T...)(T ts)
{
tloop:
    foreach (t; ts)
    {
        switch (t)
        {
            continue tloop;
            default:
        }
    }
tloop2:
    foreach (t; ts)
    {
        switch (t)
        {
            break tloop;
            default:
        }
    }
}

-- 
You are receiving this mail because:
You are watching all bug changes.
September 04, 2018
https://bugzilla.gdcproject.org/show_bug.cgi?id=307

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Actually, there's more.

---
void test307()
{
    apply307(1, 2, 3);
}

void apply307(T...)(T ts)
{
tloop:
    foreach (t; ts)
    {
        switch (t)
        {
            continue tloop;
            default:
        }
    }
tloop2:
    foreach (t; ts)
    {
        switch (t)
        {
            break tloop;
            default:
        }
    }
tloop3:
    foreach (t; ts)
    {
        switch (t)
        {
            continue;
            default:
        }
    }
tloop4:
    foreach (t; ts)
    {
        switch (t)
        {
            break;
            default:
        }
    }
}
---

I think I have a fix, though will try it out later...

-- 
You are receiving this mail because:
You are watching all bug changes.