]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GAsync: Fix async methods with struct parameters
authorJürg Billeter <j@bitron.ch>
Sun, 21 Mar 2010 15:33:44 +0000 (16:33 +0100)
committerJürg Billeter <j@bitron.ch>
Sun, 21 Mar 2010 15:33:44 +0000 (16:33 +0100)
Fixes bug 613484.

codegen/valagasyncmodule.vala
tests/Makefile.am
tests/asynchronous/bug613484.vala [new file with mode: 0644]

index c1212de106ddbe07eccfe7e6280b8bc8801d6c8a..e6ffb0d6c99bc4066590eeabf776a554e705e6ee 100644 (file)
@@ -1,6 +1,6 @@
 /* valagasyncmodule.vala
  *
- * Copyright (C) 2008-2009  Jürg Billeter
+ * Copyright (C) 2008-2010  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -219,6 +219,8 @@ internal class Vala.GAsyncModule : GSignalModule {
                                        var ma = new MemberAccess.simple (param.name);
                                        ma.symbol_reference = param;
                                        cparam = get_ref_cexpression (param.parameter_type, cparam, ma, param);
+                               } else if (param.parameter_type.is_real_non_null_struct_type ()) {
+                                       cparam = new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, cparam);
                                }
 
                                asyncblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeMemberAccess.pointer (data_var, get_variable_cname (param.name)), cparam)));
index dbad7ba043c70f39062095e35902615988498fee..b746e19c867a33f789fcfa6b7432c019f8c754d8 100644 (file)
@@ -77,6 +77,7 @@ TESTS = \
        asynchronous/bug599568.vala \
        asynchronous/bug600827.vala \
        asynchronous/bug601558.vala \
+       asynchronous/bug613484.vala \
        dbus/basic-types.test \
        dbus/arrays.test \
        dbus/structs.test \
diff --git a/tests/asynchronous/bug613484.vala b/tests/asynchronous/bug613484.vala
new file mode 100644 (file)
index 0000000..581686f
--- /dev/null
@@ -0,0 +1,12 @@
+struct Foo {
+       int i;
+}
+
+void do_foo (Foo foo) {
+}
+
+async void do_foo_async (Foo foo) {
+}
+
+void main () {
+}