]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix assertion failure on empty string switch statement
authorJürg Billeter <j@bitron.ch>
Sat, 2 Jun 2012 16:26:09 +0000 (18:26 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 23 Jun 2012 15:28:14 +0000 (17:28 +0200)
Fixes bug 677205.

codegen/valaccodecontrolflowmodule.vala

index 5a4c29792524aebf471372155936118922af48d3..ea64522489eb2373e0d06dbdab4f4e16252f2bd1 100644 (file)
@@ -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) {