vala r1563 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1563 - in trunk: . gobject
- Date: Wed, 4 Jun 2008 14:59:09 +0000 (UTC)
Author: juergbi
Date: Wed Jun 4 14:59:08 2008
New Revision: 1563
URL: http://svn.gnome.org/viewvc/vala?rev=1563&view=rev
Log:
2008-06-04 JÃrg Billeter <j bitron ch>
* gobject/valaccodeassignmentbinding.vala:
* gobject/valaccodegenerator.vala:
Fix error reporting when duplicating non-reference counted objects,
fixes bug 535849
Modified:
trunk/ChangeLog
trunk/gobject/valaccodeassignmentbinding.vala
trunk/gobject/valaccodegenerator.vala
Modified: trunk/gobject/valaccodeassignmentbinding.vala
==============================================================================
--- trunk/gobject/valaccodeassignmentbinding.vala (original)
+++ trunk/gobject/valaccodeassignmentbinding.vala Wed Jun 4 14:59:08 2008
@@ -342,6 +342,11 @@
public override void emit () {
assignment.accept_children (codegen);
+ if (assignment.left.error || assignment.right.error) {
+ assignment.error = true;
+ return;
+ }
+
if (assignment.left.symbol_reference is Property) {
emit_property_assignment ();
} else if (assignment.left.symbol_reference is Signal) {
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Wed Jun 4 14:59:08 2008
@@ -1075,6 +1075,10 @@
var cblock = new CCodeBlock ();
foreach (CodeNode stmt in b.get_statements ()) {
+ if (stmt.error) {
+ continue;
+ }
+
var src = stmt.source_reference;
if (src != null && src.comment != null) {
cblock.add_statement (new CCodeComment (src.comment));
@@ -1663,6 +1667,11 @@
}
public override void visit_expression_statement (ExpressionStatement stmt) {
+ if (stmt.expression.error) {
+ stmt.error = true;
+ return;
+ }
+
stmt.ccodenode = new CCodeExpressionStatement ((CCodeExpression) stmt.expression.ccodenode);
if (stmt.tree_can_fail && stmt.expression.tree_can_fail) {
@@ -3521,7 +3530,11 @@
if (target_type.value_owned && (!expression_type.value_owned || boxing || unboxing)) {
// need to copy value
if (requires_copy (target_type) && !(expression_type is NullType)) {
- cexpr = get_ref_cexpression (target_type, cexpr, expr, expression_type);
+ CodeNode node = expr;
+ if (node == null) {
+ node = expression_type;
+ }
+ cexpr = get_ref_cexpression (target_type, cexpr, expr, node);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]