Commit 5bf609bd authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vcc: Cross reference VMOD symbols

With a default read mask based on the type of symbol. Starting with a
default comprehensive mask should then help implement the $Restrict
stanza from VIP4, simply by AND-ing the masks.
parent 903fa456
......@@ -455,14 +455,14 @@ vcc_do_arg(struct vcc *tl, struct func_arg *fa)
static void
vcc_func(struct vcc *tl, struct expr **e, const void *priv,
const char *extra, const struct symbol *sym)
const char *extra, struct symbol *sym)
{
vcc_type_t rfmt;
const char *cfunc;
struct expr *e1;
struct func_arg *fa, *fa2;
VTAILQ_HEAD(,func_arg) head;
struct token *t1;
struct token *tf, *t1;
const struct vjsn_val *vv, *vvp;
const char *sa, *extra_sep;
char ssa[64];
......@@ -492,6 +492,7 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv,
AN((*e)->instance);
extra = (*e)->instance->rname;
}
tf = VTAILQ_PREV(tl->t, tokenhead, list);
SkipToken(tl, '(');
if (extra == NULL) {
extra = "";
......@@ -631,6 +632,7 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv,
*e = vcc_expr_edit(tl, e1->fmt, "\v1\v-\n)", e1, NULL);
}
SkipToken(tl, ')');
vcc_AddUses(tl, tf, NULL, sym, XREF_READ);
}
......
......@@ -97,6 +97,7 @@ func_sym(struct vcc *tl, vcc_kind_t kind, const struct symbol *psym,
if (kind == SYM_OBJECT) {
sym->eval_priv = v;
sym->vmod_name = psym->vmod_name;
sym->r_methods = VCL_MET_INIT;
vcc_VmodObject(tl, sym);
vcc_VmodSymbols(tl, sym);
return;
......@@ -118,6 +119,7 @@ func_sym(struct vcc *tl, vcc_kind_t kind, const struct symbol *psym,
assert(v->type == VJSN_STRING);
sym->type = VCC_Type(v->value);
AN(sym->type);
sym->r_methods = VCL_MET_TASK_C|VCL_MET_TASK_B|VCL_MET_TASK_H;
}
static void
......
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