]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Add the missing jump from after the actual last case
authorWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 19 Nov 2012 21:17:24 +0000 (22:17 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 19 Nov 2012 21:17:24 +0000 (22:17 +0100)
ast.c

diff --git a/ast.c b/ast.c
index c503c65d617c26121967a140af093fb97962ac0b..e7d5f099a58592133b24044952e6f8a48011b029 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -2367,6 +2367,14 @@ bool ast_switch_codegen(ast_switch *self, ast_function *func, bool lvalue, ir_va
         }
     }
 
+    /* Jump from the last bnot to bout */
+    if (bfall && !bfall->final && !ir_block_create_jump(bfall, bout)) {
+        /*
+        astwarning(ast_ctx(bfall), WARN_???, "missing break after last case");
+        */
+        return false;
+    }
+
     /* If there was a default case, put it down here */
     if (def_case) {
         ir_block *bcase;