Thread overview
[Bug 71] ICE with std.algorith.uniq
Jul 09, 2013
Iain Buclaw
Jul 09, 2013
Iain Buclaw
Jul 09, 2013
Iain Buclaw
Jul 09, 2013
Iain Buclaw
Jul 09, 2013
Iain Buclaw
Jul 09, 2013
Iain Buclaw
July 09, 2013
http://bugzilla.gdcproject.org/show_bug.cgi?id=71

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> 2013-07-09 20:41:27 UTC ---
Ideally, would like a smaller test without imports. (this one produces just under 10,000 lines of code :)

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
July 09, 2013
http://bugzilla.gdcproject.org/show_bug.cgi?id=71

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> 2013-07-09 20:46:32 UTC ---
Anyways... it's a frontend closure bug.

(gdb) call debug_generic_expr (exp)
this

(gdb) p exp.base.code
$1 = PARM_DECL

(gdb) call debug_generic_expr (decl_function_context (exp))
CanonicalHuffman.print

(gdb) call debug_generic_expr (current_function_decl)
CanonicalHuffman.print.UniqResult!(__lambda6, SortedRange!(Tuple!(ulong,
Leaf)[], __lambda3)).UniqResult.save


Tut tut, you can't access a parameter from outside of it's context mate...

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
July 09, 2013
http://bugzilla.gdcproject.org/show_bug.cgi?id=71

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> 2013-07-09 20:53:19 UTC ---
(In reply to comment #2)
> Anyways... it's a frontend closure bug.
> 

Failing line:

__ctmp1809->this = this;

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
July 09, 2013
http://bugzilla.gdcproject.org/show_bug.cgi?id=71

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> 2013-07-09 21:09:31 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > Anyways... it's a frontend closure bug.
> > 
> 
> Failing line:
> 
> __ctmp1809->this = this;

Area that generates the bad code:

StructLiteralExp::toElem

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
July 09, 2013
http://bugzilla.gdcproject.org/show_bug.cgi?id=71

Iain Buclaw <ibuclaw@gdcproject.org> changed:

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

--- Comment #5 from Iain Buclaw <ibuclaw@gdcproject.org> 2013-07-09 22:41:27 UTC ---
@@ -3594,8 +3594,6 @@ IRState::getVThis (Dsymbol *decl, Expression *e)
          if (ffo->creates_frame || ffo->static_chain
              || fdo->hasNestedFrameRefs())
            vthis_value = get_frame_for_symbol (this->func, sd);
-         else if (fdo->vthis && fdo->vthis->type != Type::tvoidptr)
-           vthis_value = get_decl_tree (fdo->vthis, this->func);
          else
            vthis_value = d_null_pointer;
        }


This was copied from class decls above, and applies to code such as:

class C16
{
    int w = 3;

    void iterator()
    {
        class Foo
        {
            void current()
            {
                assert(w == 3);   // Access parent from here.
            }
        }

        Foo f = new Foo();
        f.current();
    }
}


However, this is not valid for structs (struct Foo cannot access struct C16).

Running through testsuite atm.

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
July 09, 2013
http://bugzilla.gdcproject.org/show_bug.cgi?id=71

Iain Buclaw <ibuclaw@gdcproject.org> changed:

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

--- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> 2013-07-09 23:35:32 UTC ---
https://github.com/D-Programming-GDC/GDC/commit/9f1bea381f55fdc3e68818a31cad9634c77602c0

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.