]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dbus: Copy type when declaring temporary variables
authorLuca Bruno <lucabru@src.gnome.org>
Fri, 26 Oct 2012 11:46:42 +0000 (13:46 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 11 Mar 2019 12:52:38 +0000 (13:52 +0100)
If type is not copied, then the semantic analyzer will modify the
original type.

codegen/valagdbusservertransformer.vala

index 3dccdbfe319f62f6db47b18b0425266f4cc87ac7..418f955e0e7a451ec8a5c917a87037717e58c9e2 100644 (file)
@@ -106,7 +106,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
                b.open_try ();
                string result = null;
                if (m.has_result) {
-                       result = b.add_temp_declaration (m.return_type);
+                       result = b.add_temp_declaration (copy_type (m.return_type));
                        b.add_assignment (expression (result), finish_call);
                } else {
                        b.add_expression (finish_call);