diff options
author | Juerg Billeter <j@bitron.ch> | 2008-01-23 15:26:07 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-01-23 15:26:07 +0000 |
commit | 92a2bd696c9d174bbd579b44ea6823a88bef9a97 (patch) | |
tree | 71a7d7ef5efb4ad8e5dcf90f922f5861e3c7ec57 /vala/valaforstatement.vala | |
parent | d8d589fb944d1991dd9feca866b90dac3ac52377 (diff) | |
download | vala-92a2bd696c9d174bbd579b44ea6823a88bef9a97.tar.gz |
build control flow graph, report error for missing return statement in
2008-01-23 Juerg Billeter <j@bitron.ch>
* vala/Makefile.am, vala/valabasicblock.vala, vala/valacfgbuilder.vala,
vala/valadostatement.vala, vala/valaforstatement.vala,
vala/valaifstatement.vala, vala/valamemorymanager.vala,
vala/valamethod.vala, vala/valasemanticanalyzer.vala,
vala/valasymbolresolver.vala, vala/valawhilestatement.vala,
gobject/valaccodegenerator.vala, compiler/valacompiler.vala: build
control flow graph, report error for missing return statement in
non-void methods, and report warning for unreachable code,
fixes bug 508480
* tests/exceptions.vala: add missing return statement
svn path=/trunk/; revision=894
Diffstat (limited to 'vala/valaforstatement.vala')
-rw-r--r-- | vala/valaforstatement.vala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vala/valaforstatement.vala b/vala/valaforstatement.vala index 7d6327bde..68676e0d1 100644 --- a/vala/valaforstatement.vala +++ b/vala/valaforstatement.vala @@ -1,6 +1,6 @@ /* valaforstatement.vala * - * Copyright (C) 2006-2007 Jürg Billeter + * Copyright (C) 2006-2008 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -109,6 +109,10 @@ public class Vala.ForStatement : CodeNode, Statement { } public override void accept (CodeVisitor! visitor) { + visitor.visit_for_statement (this); + } + + public override void accept_children (CodeVisitor! visitor) { foreach (Expression init_expr in initializer) { init_expr.accept (visitor); visitor.visit_end_full_expression (init_expr); @@ -124,8 +128,6 @@ public class Vala.ForStatement : CodeNode, Statement { } body.accept (visitor); - - visitor.visit_for_statement (this); } public override void replace_expression (Expression! old_node, Expression! new_node) { |