changeset 1291:5ef63ca6e8c3

When inside a loop, if you call break inside a try block the finally block is never executed Juan Jose Comellas <juanjo@comellas.com.ar> 2006-11-30 http://d.puremagic.com/issues/show_bug.cgi?id=621
author thomask
date Sat, 30 Dec 2006 13:39:30 +0000
parents e3d0dea394ab
children 6b1e9ade787e
files run/b/break_12_A.d run/b/break_12_B.d
diffstat 2 files changed, 55 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/b/break_12_A.d	Sat Dec 30 13:39:30 2006 +0000
@@ -0,0 +1,28 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Juan Jose Comellas <juanjo@comellas.com.ar>
+// @date@	2006-11-30
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=621
+// @desc@	When inside a loop, if you call break inside a try block the finally block is never executed
+
+module dstress.run.b.break_12_A;
+
+int main(){
+	int status = 1;
+
+	while(true){
+		try{
+			status += 1;
+			break;
+		}finally{
+			status *= 7;
+		}
+	}
+	if(status != 14){
+		assert(0);
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/b/break_12_B.d	Sat Dec 30 13:39:30 2006 +0000
@@ -0,0 +1,27 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Juan Jose Comellas <juanjo@comellas.com.ar>
+// @date@	2006-11-30
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=621
+// @desc@	When inside a loop, if you call break inside a try block the finally block is never executed
+
+module dstress.run.b.break_12_B;
+
+int main(){
+	int status = 1;
+
+	try{
+		status += 1;
+		break;
+	}finally{
+		status *= 7;
+	}
+
+	if(status != 14){
+		assert(0);
+	}
+
+	return 0;
+}