From 99cb50d4f13d587e3a0e0f2a44485f301409afb4 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 11 Aug 2022 06:25:30 +0200 Subject: fixs --- bootstrap/env.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'bootstrap/env.c') diff --git a/bootstrap/env.c b/bootstrap/env.c index 2c5e80f..ec80e62 100644 --- a/bootstrap/env.c +++ b/bootstrap/env.c @@ -32,14 +32,12 @@ envput(struct env *env, const struct decl *decl) { static int age; if ((d0 = envfind(&env_noparent, INT_MAX, decl->name))) { - if (decl == d0 || !memcmp(d0, decl, sizeof *d0)) - return d0; // modify existing forward declarations? - if (d0->t != decl->t) - return NULL; if (d0->t == Dmacro && !memcmp(&decl->macro, &d0->macro, sizeof decl->macro)) return d0; - for (int kind = TYstruct; kind <= TYunion; ++kind) { + if (d0->t == Dtepl && !memcmp(&decl->tepl, &d0->tepl, sizeof decl->tepl)) + return d0; + for (int kind = TYstruct; kind <= TYeunion; ++kind) { if (d0->t == Dtype && d0->ty->t == kind && decl->t == Dtype && decl->ty->t == kind && d0->ty->agg.fwd) { *(size_t *)&d0->ty->size = decl->ty->size; -- cgit v1.2.3