Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
March 30, 2003 DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
www.digitalmars.com/d/changelog.html |
March 30, 2003 Re: DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | In article <b66c01$155t$1@digitaldaemon.com>, Walter says... > > >www.digitalmars.com/d/changelog.html > > please add "http://" in future announce posts to save us from cut and paste (at least with MS IE on Win98 thank you |
March 31, 2003 Re: DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Here's some malicous D code, that crashes DMD 0.61 and causes a linker error: void func() { void* ptr; int[5] array; void ptr*; /* BUG: compiler crashes after saying semicolon expected, not '*' expression expected, not ';' */ if (array==ptr[]) // BUG: should not compile { } } Farmer. |
April 01, 2003 Re: DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> www.digitalmars.com/d/changelog.html
>
>
Hallo,
this code causes dmd 0.61 to crash:
template TList(T)
{
class Node
{
Node prev;
Node next;
T Value;
}
class List
{
Node m_first = null;
Node m_last = null;
void AddFront(T _Value)
{
Node cur = new Node;
with (cur)
{
next = m_first;
prev = null;
Value = _Value;
if (next != null) next.prev = cur;
}
m_first = null;
if (m_last == null) m_last = cur;
}
}
}
void main(char[][] argv)
{
alias instance TList(uint).List UIntList;
alias instance TList(uint).Node UIntNode;
UIntList list;
UIntNode node;
for (int i = 1; i <= 10; i++) list.AddFront(i);
}
|
April 01, 2003 Re: DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stephan Wienczny |
Stephan Wienczny wrote:
>
> Walter wrote:
> > www.digitalmars.com/d/changelog.html
> >
> >
> Hallo,
>
> this code causes dmd 0.61 to crash:
>
> template TList(T)
> {
> class Node
> {
> Node prev;
> Node next;
> T Value;
> }
> class List
> {
> Node m_first = null;
> Node m_last = null;
> void AddFront(T _Value)
> {
> Node cur = new Node;
> with (cur)
> {
> next = m_first;
> prev = null;
> Value = _Value;
> if (next != null) next.prev = cur;
> }
> m_first = null;
> if (m_last == null) m_last = cur;
> }
> }
> }
>
> void main(char[][] argv)
> {
> alias instance TList(uint).List UIntList;
> alias instance TList(uint).Node UIntNode;
> UIntList list;
> UIntNode node;
> for (int i = 1; i <= 10; i++) list.AddFront(i);
> }
Der Code
UIntList list;
erzeugt noch kein gültiges Objekt, dessen Methoden du mit
list.AddFront(i);
verwenden könntest.
Siehe dagegen oben:
Node cur = new Node;
D ist da ganz gleich wie z. B. Java.
--
Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com
|
April 01, 2003 Re: DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | Helmut Leitner wrote:
>
> Stephan Wienczny wrote:
>
>>Walter wrote:
>>
>>>www.digitalmars.com/d/changelog.html
>>>
>>>
>>
>> Hallo,
>>
>>this code causes dmd 0.61 to crash:
>>
>>template TList(T)
>>{
>> class Node
>> {
>> Node prev;
>> Node next;
>> T Value;
>> }
>> class List
>> {
>> Node m_first = null;
>> Node m_last = null;
>> void AddFront(T _Value)
>> {
>> Node cur = new Node;
>> with (cur)
>> {
>> next = m_first;
>> prev = null;
>> Value = _Value;
>> if (next != null) next.prev = cur;
>> }
>> m_first = null;
>> if (m_last == null) m_last = cur;
>> }
>> }
>>}
>>
>>void main(char[][] argv)
>>{
>> alias instance TList(uint).List UIntList;
>> alias instance TList(uint).Node UIntNode;
>> UIntList list;
>> UIntNode node;
>> for (int i = 1; i <= 10; i++) list.AddFront(i);
>>}
>
>
> Der Code
> UIntList list;
> erzeugt noch kein gültiges Objekt, dessen Methoden du mit
> list.AddFront(i);
> verwenden könntest.
>
> Siehe dagegen oben:
> Node cur = new Node;
>
> D ist da ganz gleich wie z. B. Java.
>
> --
> Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com
Das ist als D-Newbie gut zu wissen! Das Problem ist aber, dass der Compiler ohne Fehlermeldung abschmiert. Das sollte nicht passieren...
Cu Stephan
|
April 02, 2003 Re: DMD 0.61 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stephan Wienczny | I have it fixed now. In the meantime, you can work around it by putting the alias declarations at module rather than function scope. |
Copyright © 1999-2021 by the D Language Foundation