[vala] GAsync: Fix generated sync method variant
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [vala] GAsync: Fix generated sync method variant
- Date: Fri, 3 Jul 2009 14:38:29 +0000 (UTC)
commit a6dc7b4bc17456e1e8d1a800b931722a8b4f31bf
Author: Didier 'Ptitjes <ptitjes free fr>
Date: Tue Jun 2 05:50:58 2009 +0200
GAsync: Fix generated sync method variant
Yield statements must be ignored in synchronous variant.
Signed-off-by: Didier 'Ptitjes <ptitjes free fr>
codegen/valagasyncmodule.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valagasyncmodule.vala b/codegen/valagasyncmodule.vala
index 5b4f7f7..c49f6a2 100644
--- a/codegen/valagasyncmodule.vala
+++ b/codegen/valagasyncmodule.vala
@@ -316,6 +316,11 @@ internal class Vala.GAsyncModule : GSignalModule {
}
public override void visit_yield_statement (YieldStatement stmt) {
+ if (current_method == null || !current_method.coroutine) {
+ stmt.ccodenode = new CCodeEmptyStatement ();
+ return;
+ }
+
if (stmt.yield_expression == null) {
// should be replaced by a simple return FALSE; when we have
// void idle () yields;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]