]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
prog_leavefunction needs to take the ++st into account - otherwise INSTR_RETURN ends...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:28:59 +0000 (16:28 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:28:59 +0000 (16:28 +0200)
exec.c

diff --git a/exec.c b/exec.c
index 348d2af313c72b45817f3845f47cb92a29cc4edd..66095f59a0edb1d35bc2f5b979491d04e19a3f26 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -512,7 +512,7 @@ static qcint prog_leavefunction(qc_program *prog)
         exit(1);
     }
 
-    return st.stmt;
+    return st.stmt - 1; /* offset the ++st */
 }
 
 bool prog_exec(qc_program *prog, prog_section_function *func, size_t flags, long maxjumps)