diff options
| author | 2022-08-11 06:25:30 +0200 | |
|---|---|---|
| committer | 2022-08-11 06:25:30 +0200 | |
| commit | 99cb50d4f13d587e3a0e0f2a44485f301409afb4 (patch) | |
| tree | c285338782ae3cd760252337a488f10fe940e45b /bootstrap/env.c | |
| parent | 8d3c3d919183a4a6ba7ad8010587dee6f5f96baa (diff) | |
fixs
Diffstat (limited to 'bootstrap/env.c')
| -rw-r--r-- | bootstrap/env.c | 8 |
1 files changed, 3 insertions, 5 deletions
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; |