summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-02-13 17:30:29 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-02-13 17:30:29 +0100
commit6ed2ec810d75f49478dbfdb5c6d98b2fc909e9f6 (patch)
treec03953e8fce0168ad9997c58cfae476a8b4dd3ee
parent11c843e980a4f45bd058863ab4397dcc27fb2b52 (diff)
downloadvala-6ed2ec810d75f49478dbfdb5c6d98b2fc909e9f6.tar.gz
codegen: Don't create duplicated complete-async code
Treat methods with non-void return-type special while they require a return statement. This does not account for a trailing superfluous "return" which will still trigger this code-duplication. https://bugzilla.gnome.org/show_bug.cgi?id=778302
-rw-r--r--codegen/valaccodemethodmodule.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 1f47af9c8..f28fe86d0 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -769,7 +769,8 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
}
}
- if (m.coroutine) {
+ // For non-void return-types GAsyncModule.visit_return_statement () will take care of this
+ if (m.return_type is VoidType && m.coroutine) {
// epilogue
complete_async ();
}