2008-02-05 Juerg Billeter <j@bitron.ch>
* vala/valacfgbuilder.vala: assume that control flow ends when
invoking a method with the [NoReturn] attribute
* vapi/glib-2.0.vapi: add [NoReturn] to assert_not_reached
svn path=/trunk/; revision=974
2008-02-05 Jürg Billeter <j@bitron.ch>
+ * vala/valacfgbuilder.vala: assume that control flow ends when
+ invoking a method with the [NoReturn] attribute
+
+ * vapi/glib-2.0.vapi: add [NoReturn] to assert_not_reached
+
+2008-02-05 Jürg Billeter <j@bitron.ch>
+
* vala/valasemanticanalyzer.vala: set tree_can_fail for assignments
that can fail
current_block.add_node (stmt);
handle_errors (stmt);
+
+ if (stmt.expression is InvocationExpression) {
+ var expr = (InvocationExpression) stmt.expression;
+ var ma = expr.call as MemberAccess;
+ if (ma.symbol_reference != null && ma.symbol_reference.get_attribute ("NoReturn") != null) {
+ current_block = null;
+ unreachable_reported = false;
+ return;
+ }
+ }
}
public override void visit_if_statement (IfStatement! stmt) {
public static void return_if_fail (bool expr);
public static void assert (bool expr);
+ [NoReturn]
public static void assert_not_reached ();
/* Message Logging */