vala r1570 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1570 - in trunk: . gobject
- Date: Thu, 12 Jun 2008 12:26:44 +0000 (UTC)
Author: juergbi
Date: Thu Jun 12 12:26:44 2008
New Revision: 1570
URL: http://svn.gnome.org/viewvc/vala?rev=1570&view=rev
Log:
2008-06-12 JÃrg Billeter <j bitron ch>
* gobject/valaccodedynamicmethodbinding.vala:
Fix application crash when a D-Bus client method raises an error
Modified:
trunk/ChangeLog
trunk/gobject/valaccodedynamicmethodbinding.vala
Modified: trunk/gobject/valaccodedynamicmethodbinding.vala
==============================================================================
--- trunk/gobject/valaccodedynamicmethodbinding.vala (original)
+++ trunk/gobject/valaccodedynamicmethodbinding.vala Thu Jun 12 12:26:44 2008
@@ -344,6 +344,12 @@
block.add_statement (new CCodeExpressionStatement (ccall));
+ // don't access result when error occured
+ var creturnblock = new CCodeBlock ();
+ creturnblock.add_statement (new CCodeReturnStatement (codegen.default_value_for_type (method.return_type, false)));
+ var cerrorif = new CCodeIfStatement (new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, new CCodeIdentifier ("error")), creturnblock);
+ block.add_statement (cerrorif);
+
block.add_statement (out_marshalling_fragment);
// *result_length1 = result->len;
@@ -374,6 +380,12 @@
block.add_statement (new CCodeExpressionStatement (ccall));
+ // don't access result when error occured
+ var creturnblock = new CCodeBlock ();
+ creturnblock.add_statement (new CCodeReturnStatement (codegen.default_value_for_type (method.return_type, false)));
+ var cerrorif = new CCodeIfStatement (new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, new CCodeIdentifier ("error")), creturnblock);
+ block.add_statement (cerrorif);
+
block.add_statement (out_marshalling_fragment);
if (array_type != null) {
@@ -392,6 +404,12 @@
} else {
block.add_statement (new CCodeExpressionStatement (ccall));
+ // don't access result when error occured
+ var creturnblock = new CCodeBlock ();
+ creturnblock.add_statement (new CCodeReturnStatement ());
+ var cerrorif = new CCodeIfStatement (new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, new CCodeIdentifier ("error")), creturnblock);
+ block.add_statement (cerrorif);
+
block.add_statement (out_marshalling_fragment);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]