[vala/wip/transform: 88/139] Do not handle binary expressions without parent statement
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/transform: 88/139] Do not handle binary expressions without parent statement
- Date: Mon, 17 Oct 2016 20:12:54 +0000 (UTC)
commit 4a2b3fb9fdd00dceb264e2b8e8f896190867e7ed
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Feb 9 13:45:57 2012 +0100
Do not handle binary expressions without parent statement
codegen/valaccodetransformer.vala | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index 76ff0de..a1ec39d 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -210,8 +210,6 @@ public class Vala.CCodeTransformer : CodeTransformer {
// convert to simple loop
push_builder (new CodeBuilder (context, stmt, stmt.source_reference));
- var block = new Block (stmt.source_reference);
-
// initializer
foreach (var init_expr in stmt.get_initializer ()) {
b.add_expression (init_expr);
@@ -401,10 +399,16 @@ public class Vala.CCodeTransformer : CodeTransformer {
}
public override void visit_binary_expression (BinaryExpression expr) {
+ var parent_statement = expr.parent_statement;
+ if (parent_statement == null) {
+ base.visit_binary_expression (expr);
+ return;
+ }
+
Expression replacement = null;
var old_parent_node = expr.parent_node;
var target_type = expr.target_type != null ? expr.target_type.copy () : null;
- push_builder (new CodeBuilder (context, expr.parent_statement, expr.source_reference));
+ push_builder (new CodeBuilder (context, parent_statement, expr.source_reference));
if (context.analyzer.get_current_symbol (expr) is Block
&& (expr.operator == BinaryOperator.AND || expr.operator == BinaryOperator.OR)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]