diff options
Diffstat (limited to 'src/prc1/td.c')
| -rw-r--r-- | src/prc1/td.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/prc1/td.c b/src/prc1/td.c index af88af8..4f894af 100644 --- a/src/prc1/td.c +++ b/src/prc1/td.c @@ -98,9 +98,10 @@ static void insert(struct td *td, struct type *t) static int cid(const struct lex *l, struct prv *p) { const struct fn *fn = fn_cur(p); + const char *tr = triplet(p); const struct tk *id = p->stk, *v = p->stk + 3; const struct stentry *e; - const struct type *t = type_find(fn, id->s); + const struct type *t = type_find(fn, tr, id->s); struct tdconstant *tdc = p->tdc; struct td *td = fn->td; struct type *nt; @@ -127,7 +128,7 @@ static int cid(const struct lex *l, struct prv *p) v->s, loc->f, loc->line, loc->col); return -1; } - else if (!(t = type_find(fn, v->s))) + else if (!(t = type_find(fn, tr, v->s))) { errloc(id, "undefined reference to value \"%s\"", v->s); return -1; @@ -173,12 +174,12 @@ static int cnum(const struct lex *l, struct prv *p) { const struct fn *fn = fn_cur(p); const struct tk *id = p->stk, *num = p->stk + 3; - const char *name = id->s; + const char *name = id->s, *tr = triplet(p); const struct stentry *e; struct td *td = fn->td; struct type *nt; struct tdconstant *tdc = p->tdc; - const struct type *t = type_find(fn, name); + const struct type *t = type_find(fn, tr, name); int sign = *num->s == '-'; unsigned long long uv = 0; const struct loc *loc; @@ -247,8 +248,9 @@ static int c(const struct lex *l, struct prv *p) { const struct fn *fn = fn_cur(p); const struct tk *id = p->stk; + const char *tr = triplet(p); const struct stentry *e; - const struct type *t = type_find(fn, id->s); + const struct type *t = type_find(fn, tr, id->s); struct td *td = fn->td; struct type *nt; const struct tdconstant *tdc = p->tdc; @@ -426,10 +428,11 @@ static int end(const struct lex *l, struct prv *p) static int s(const struct lex *l, struct prv *p) { const struct tk *id = p->stk; + const char *tr = triplet(p); struct fn *fn = fn_cur(p); struct td *td = fn->td; struct type *nt; - const struct type *t = type_find(fn, id->s); + const struct type *t = type_find(fn, tr, id->s); if (t) { @@ -467,8 +470,9 @@ static int tt(const struct lex *l, struct prv *p, const struct type *t) { int ret = -1; const struct fn *fn = fn_cur(p); + const char *tr = triplet(p); const struct tk *id = p->id; - const struct type *tp = type_ufind(fn, id->s); + const struct type *tp = type_ufind(fn, tr, id->s); const struct loc *loc = &id->loc; struct td *td = fn->td; struct type *nt; |
