[新闻] DMD 1.039 and 2.023 releases

hurd 2009-01-07
http://www.digitalmars.com/d/1.0/changelog.html
http://ftp.digitalmars.com/dmd.1.039.zip

http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.023.zip


Version D 1.039   Jan 2, 2009
New/Changed Features

    * Improved speed of long division.
    * Added predefined version D_Ddoc which is predefined when -D switch is thrown.

Bugs Fixed

    * Bugzilla 2517: DDoc omits abstract on classes
    * Bugzilla 2518: scope(success) not execuate and RAII variable destructor is not called
    * Bugzilla 2519: Segfault when >> used in an invalid slice
    * Bugzilla 2527: Alias Template Params Are Always Same Type As First Instantiation (according to typeof(x).stringof)
    * Bugzilla 2531: DDoc not generated correctly for struct methods inside static if
    * Bugzilla 2537: compiler crashes on this code:
    * Bugzilla 2542: array casts behave differently at compile and runtime
hurd 2009-01-07
Version D 2.023   Jan 2, 2009
New/Changed Features

    * Improved speed of long division.
    * Optimizer now takes advantage of immutable and pure.
    * Added predefined version D_Ddoc which is predefined when -D switch is thrown.
    * the type of a string literal is now invariant(char)[] rather than invariant(char)[length_of_string]. It is still implicitly convertible to the latter. This is intended to reduce template instantiation bloat.
    * Undid fix for Bugzilla 2500, as the fix was arguably worse than the bug.

Bugs Fixed

    * Bugzilla 1078: Frontend uses of 'auto' where 'scope' should be used
    * Bugzilla 2517: DDoc omits abstract on classes
    * Bugzilla 2518: scope(success) not execuate and RAII variable destructor is not called
    * Bugzilla 2519: Segfault when >> used in an invalid slice
    * Bugzilla 2527: Alias Template Params Are Always Same Type As First Instantiation (according to typeof(x).stringof)
    * Bugzilla 2531: DDoc not generated correctly for struct methods inside static if
    * Bugzilla 2533: compiler falls with "assertion failed" message on wrong code
    * Bugzilla 2534: dmd.conf is wrong
    * Bugzilla 2537: compiler crashes on this code:
    * Bugzilla 2541: cannot use aliased type for decl of foreach variable
    * Bugzilla 2542: array casts behave differently at compile and runtime
hurd 2009-01-07
redsea大哥报告的RAII问题解决了。。。。
hqs7636 2009-01-07
好快啊,

这个版本druntime算是整合好了


为什么druntime 没有文档???
redsea 2009-01-08
hurd 写道
redsea大哥报告的RAII问题解决了。。。。


这真让人高兴

scope和raii  相关的 bug, dstress 里面还有好几个没有解决.
不能通过编译的无所谓, 可以改写代码, 让人害怕的是可以通过编译, 结果不对的.

现有几个如下:

--------
int i[];

scope class A{
	~this(){
		i ~= 3;
	}
}

int main(){
	i ~= 0;

	goto L1;
	{
		L1:
			scope a = new A();
			scope(exit) i ~= 2;
			i ~= 1;
	}
	i ~= 4;
	
	if([0, 1, 2, 3, 4] != i){
		assert(0);
	}

	return 0;
}

---------
int i[];

scope class A{
	~this(){
		i ~= 3;
	}
}

int main(){
	i ~= 0;

	switch(i.length)
	{
		case 1:
			goto L2;
		L2:
			scope a = new A();
			scope(exit) i ~= 2;
			i ~= 1;
			break;
	}
	i ~= 4;
	
	if([0, 1, 2, 3, 4] != i){
		assert(0);
	}

	return 0;
}

--------------

这两个故事教导我们, goto 很危险, 特别是同时还用 scope. raii 变量的时候.

还有一个 Walter 说不是 bug, 但是很诡异:


int main(){
	int i;
	
label: 
	{
		scope(exit) i++;
		i=3;
	}

	if(i != 4){
		assert(0);
	}


	return 0;
}


Walter 大大说, label 后面紧跟的花括号不开始一个新的作用域(这样的话, 执行 if 的时候, scope exit 确实还没有执行).

这也太诡异了一些.

这进一步教导我们, 不要用 label, 不要用 goto, 除非不想做地球人.


yntcsb 2009-01-09

似乎与tango库不兼容,dmd1.039编译最新的tango下载库文件只能 编译出user库和win32库,而基本库不行。

Global site tag (gtag.js) - Google Analytics