[vala/staging] codegen: Don't create duplicated complete-async code
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] codegen: Don't create duplicated complete-async code
- Date: Mon, 13 Feb 2017 16:38:51 +0000 (UTC)
commit 6ed2ec810d75f49478dbfdb5c6d98b2fc909e9f6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Feb 13 17:30:29 2017 +0100
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
codegen/valaccodemethodmodule.vala | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 1f47af9..f28fe86 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 ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]