]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.c
Fix out of bound access
[xonotic/gmqcc.git] / ir.c
diff --git a/ir.c b/ir.c
index 09fa186a2f83b0300af949b3c1ed021cec682ff3..72e7406d663b9f570a90d890ee2e56257ca63d66 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2624,7 +2624,7 @@ bool ir_function_calculate_liferanges(ir_function *self)
             if (v->memberof) {
                 ir_value *vec = v->memberof;
                 for (s = 0; s < vec_size(vec->reads); ++s) {
-                    if (vec->reads[s]->eid == v->life[0].end)
+                    if (vec->reads[s]->eid == vec->life[0].end)
                         break;
                 }
                 if (s < vec_size(vec->reads)) {
@@ -3779,7 +3779,7 @@ void ir_function_dump(ir_function *f, char *ind,
         return;
     }
     oprintf("%sfunction %s\n", ind, f->name);
-    strncat(ind, "\t", IND_BUFSZ);
+    strncat(ind, "\t", IND_BUFSZ-1);
     if (vec_size(f->locals))
     {
         oprintf("%s%i locals:\n", ind, (int)vec_size(f->locals));