]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Use correct ctype for result variable in methods in more cases
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 6 May 2024 12:20:21 +0000 (14:20 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 18 May 2024 13:50:01 +0000 (15:50 +0200)
codegen/valaccodemethodmodule.vala
tests/methods/bug699956.c-expected

index 05b9a29166da1d5e271fa9b4db98adf67aa494cf..41099ab5149c720d06c20e16add5f06de5c8ad0a 100644 (file)
@@ -831,7 +831,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                        } else {
                                vardecl = new CCodeVariableDeclarator ("result");
                        }
-                       ccode.add_declaration (get_ccode_name (m.return_type), vardecl);
+                       ccode.add_declaration (get_creturn_type (m, get_ccode_name (m.return_type)), vardecl);
                }
 
                pop_context ();
@@ -1210,7 +1210,7 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
                        } else {
                                vardecl = new CCodeVariableDeclarator ("result");
                        }
-                       ccode.add_declaration (get_ccode_name (m.return_type), vardecl);
+                       ccode.add_declaration (get_creturn_type (m, get_ccode_name (m.return_type)), vardecl);
                }
 
                // add a typecheck statement for "self"
index 80ecda19936df20078ca9be6df9f2ee8646ba99d..1771aa315352fa93eb8d0bf03fa0d227ab19d228 100644 (file)
@@ -364,7 +364,7 @@ bar_get_type (void)
 Foo*
 foo (void)
 {
-       Bar* result;
+       Foo* result;
        result = NULL;
        return result;
 }