diff options
Diffstat (limited to 'vala/valaconditionalexpression.vala')
-rw-r--r-- | vala/valaconditionalexpression.vala | 12 |
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; - } } |