[vala] codegen: Fix assertion failure on empty string switch statement



commit 896db3e2195830e74ed0b6a0d9d48c93db48278d
Author: JÃrg Billeter <j bitron ch>
Date:   Sat Jun 2 18:26:09 2012 +0200

    codegen: Fix assertion failure on empty string switch statement
    
    Fixes bug 677205.

 codegen/valaccodecontrolflowmodule.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodecontrolflowmodule.vala b/codegen/valaccodecontrolflowmodule.vala
index 5a4c297..ea64522 100644
--- a/codegen/valaccodecontrolflowmodule.vala
+++ b/codegen/valaccodecontrolflowmodule.vala
@@ -156,12 +156,12 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule {
 
 			default_section.emit (this);
 
-			if (n > 0) {
-				ccode.close ();
-			}
+			ccode.close ();
 		}
 
-		ccode.close ();
+		if (n > 0) {
+			ccode.close ();
+		}
 	}
 
 	public override void visit_switch_statement (SwitchStatement stmt) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]