summaryrefslogtreecommitdiff
path: root/vala/valaconditionalexpression.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2008-11-30 12:50:43 +0000
committerJürg Billeter <juergbi@src.gnome.org>2008-11-30 12:50:43 +0000
commit0697212ab726a72c826d27208181e026bf192cad (patch)
treef266a35833ce799ab33a2e3005031c69545fcf6b /vala/valaconditionalexpression.vala
parent457053b12382af6629ee5c64d0b2615b5ca6083b (diff)
downloadvala-0697212ab726a72c826d27208181e026bf192cad.tar.gz
Fix error handling in condition of while, do, and for statements
2008-11-30 Jürg Billeter <j@bitron.ch> * vala/valaaddressofexpression.vala: * vala/valaarraycreationexpression.vala: * vala/valaassignment.vala: * vala/valabaseaccess.vala: * vala/valabinaryexpression.vala: * vala/valablock.vala: * vala/valacastexpression.vala: * vala/valaconditionalexpression.vala: * vala/valadostatement.vala: * vala/valaelementaccess.vala: * vala/valaexpression.vala: * vala/valaforstatement.vala: * vala/valainitializerlist.vala: * vala/valalambdaexpression.vala: * vala/valaliteral.vala: * vala/valamemberaccess.vala: * vala/valamethodcall.vala: * vala/valaobjectcreationexpression.vala: * vala/valaparenthesizedexpression.vala: * vala/valapointerindirection.vala: * vala/valapostfixexpression.vala: * vala/valareferencetransferexpression.vala: * vala/valasemanticanalyzer.vala: * vala/valasizeofexpression.vala: * vala/valaswitchsection.vala: * vala/valatuple.vala: * vala/valatypecheck.vala: * vala/valatypeofexpression.vala: * vala/valaunaryexpression.vala: * vala/valawhilestatement.vala: * gobject/valaccodebasemodule.vala: Fix error handling in condition of while, do, and for statements svn path=/trunk/; revision=2096
Diffstat (limited to 'vala/valaconditionalexpression.vala')
-rw-r--r--vala/valaconditionalexpression.vala12
1 files changed, 6 insertions, 6 deletions
diff --git a/vala/valaconditionalexpression.vala b/vala/valaconditionalexpression.vala
index ff798a6a0..2d002b68b 100644
--- a/vala/valaconditionalexpression.vala
+++ b/vala/valaconditionalexpression.vala
@@ -105,6 +105,9 @@ public class Vala.ConditionalExpression : Expression {
checked = true;
+ var old_insert_block = analyzer.insert_block;
+ analyzer.insert_block = prepare_condition_split (analyzer);
+
// convert ternary expression into if statement
// required for flow analysis and exception handling
@@ -128,12 +131,13 @@ public class Vala.ConditionalExpression : Expression {
var if_stmt = new IfStatement (condition, true_block, false_block, source_reference);
- insert_statement ((Block) analyzer.current_symbol, decl);
- insert_statement ((Block) analyzer.current_symbol, if_stmt);
+ insert_statement (analyzer.insert_block, decl);
+ insert_statement (analyzer.insert_block, if_stmt);
if (!if_stmt.check (analyzer)) {
return false;
}
+ analyzer.insert_block = old_insert_block;
true_expression = true_local.initializer;
false_expression = false_local.initializer;
@@ -176,8 +180,4 @@ public class Vala.ConditionalExpression : Expression {
return true;
}
-
- public override bool in_single_basic_block () {
- return false;
- }
}