Commit 3730f544 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vcc: Promote error checks to assertions

Introduced by eabe58bc but soon after
made obsolete by 9b1f1d17.
parent 903ea603
......@@ -477,7 +477,6 @@ vcc_acl_emit_tokens(const struct vcc *tl, const struct acl_e *ae)
if (t == ae->t_mask)
break;
t = vcc_PeekTokenFrom(tl, t);
ERRCHK(tl);
AN(t);
sep = " ";
} while (ae->t_mask != NULL);
......
......@@ -739,7 +739,7 @@ vcc_expr5(struct vcc *tl, struct expr **e, vcc_type_t fmt)
case ID:
t = tl->t;
t1 = vcc_PeekToken(tl);
ERRCHK(tl);
AN(t1);
sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE,
SYMTAB_PARTIAL_NOERR, XREF_REF);
if (sym == NULL && fmt->global_pfx != NULL && t1->tok != '.') {
......
......@@ -350,15 +350,15 @@ vcc_ExpectVid(struct vcc *tl, const char *what)
ERRCHK(tl);
t2 = vcc_PeekToken(tl);
ERRCHK(tl);
AN(t2);
while (t2->tok == '.') {
bad = ".";
t2 = vcc_PeekTokenFrom(tl, t2);
ERRCHK(tl);
AN(t2);
if (t2->tok != ID)
break;
t2 = vcc_PeekTokenFrom(tl, t2);
ERRCHK(tl);
AN(t2);
}
if (bad == NULL)
bad = VCT_invalid_name(tl->t->b, tl->t->e);
......
......@@ -316,7 +316,7 @@ vcc_ParseImport(struct vcc *tl)
ExpectErr(tl, ID); /* "vmod_name" */
mod = tl->t;
tmod = vcc_PeekTokenFrom(tl, mod);
ERRCHK(tl);
AN(tmod);
if (tmod->tok == ID && vcc_IdIs(tmod, "as")) {
vcc_NextToken(tl); /* "vmod_name" */
vcc_NextToken(tl); /* "as" */
......
......@@ -124,7 +124,7 @@ vcc_AddUses(struct vcc *tl, const struct token *t1, const struct token *t2,
pu->t2 = t2;
if (pu->t2 == NULL) {
pu->t2 = vcc_PeekTokenFrom(tl, t1);
ERRCHK(tl);
AN(pu->t2);
}
pu->sym = sym;
pu->use = use;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment