isl_input.c: accept_affine_factor: drop unexpected unknown identifier
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 3 Feb 2013 12:50:49 +0000 (13:50 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 3 Feb 2013 12:50:49 +0000 (13:50 +0100)
accept_affine_factor errors out on seeing an unknown identifier, but
the identifier was incorrectly kept in the vars data structure,
possibly resulting in bad accesses if parsing continues after the error.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_input.c

index f0c3d7c..a19fe6e 100644 (file)
@@ -343,6 +343,7 @@ static __isl_give isl_pw_aff *accept_affine_factor(struct isl_stream *s,
                if (pos < 0)
                        goto error;
                if (pos >= n) {
+                       vars_drop(v, v->n - n);
                        isl_stream_error(s, tok, "unknown identifier");
                        goto error;
                }