]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - code.c
Temporarily fix noreturn bug by creating an actual dummy return instruction after...
[xonotic/gmqcc.git] / code.c
diff --git a/code.c b/code.c
index ca6c3ad655db3b3d8be74e78c52d8bd34c2d181e..3c418b1653125786a47f44355a32ae23e4da79b5 100644 (file)
--- a/code.c
+++ b/code.c
@@ -39,6 +39,12 @@ void code_push_statement(prog_section_statement *stmt, int linenum)
     vec_push(code_linenums,   linenum);
 }
 
+void code_pop_statement()
+{
+    vec_pop(code_statements);
+    vec_pop(code_linenums);
+}
+
 void code_init() {
     prog_section_function  empty_function  = {0,0,0,0,0,0,0,{0}};
     prog_section_statement empty_statement = {0,{0},{0},{0}};
@@ -213,7 +219,7 @@ bool code_write(const char *filename, const char *lnofile) {
         if (code_functions[it].entry >= 0) {
             util_debug("GEN", "    CODE:\n");
             for (;;) {
-                if (code_statements[j].opcode != AINSTR_END)
+                if (code_statements[j].opcode != INSTR_DONE)
                     util_debug("GEN", "        %-12s {% 5i,% 5i,% 5i}\n",
                         asm_instr[code_statements[j].opcode].m,
                         code_statements[j].o1.s1,