[vala] D-Bus: Fix crash when using unsupported types in dynamic clients
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] D-Bus: Fix crash when using unsupported types in dynamic clients
- Date: Sun, 2 Aug 2009 19:34:33 +0000 (UTC)
commit a334ceda26f50257fad73e31eb083c0edf84e0c2
Author: Jürg Billeter <j bitron ch>
Date: Sun Aug 2 21:31:40 2009 +0200
D-Bus: Fix crash when using unsupported types in dynamic clients
Fixes bug 586479.
codegen/valadbusclientmodule.vala | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valadbusclientmodule.vala b/codegen/valadbusclientmodule.vala
index 9dfcaae..fad0eaf 100644
--- a/codegen/valadbusclientmodule.vala
+++ b/codegen/valadbusclientmodule.vala
@@ -544,6 +544,11 @@ internal class Vala.DBusClientModule : DBusModule {
string getter_cname = "_dynamic_get_%s%d".printf (prop.name, dynamic_property_id++);
+ if (get_type_signature (prop.property_type) == null) {
+ Report.error (prop.property_type.source_reference, "D-Bus serialization of type `%s' is not supported".printf (prop.property_type.to_string ()));
+ return getter_cname;
+ }
+
var func = new CCodeFunction (getter_cname, prop.property_type.get_cname ());
func.modifiers |= CCodeModifiers.STATIC | CCodeModifiers.INLINE;
@@ -568,6 +573,11 @@ internal class Vala.DBusClientModule : DBusModule {
string setter_cname = "_dynamic_set_%s%d".printf (prop.name, dynamic_property_id++);
+ if (get_type_signature (prop.property_type) == null) {
+ Report.error (prop.property_type.source_reference, "D-Bus serialization of type `%s' is not supported".printf (prop.property_type.to_string ()));
+ return setter_cname;
+ }
+
var func = new CCodeFunction (setter_cname, "void");
func.modifiers |= CCodeModifiers.STATIC | CCodeModifiers.INLINE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]