aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/env.c')
-rw-r--r--bootstrap/env.c8
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;