Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: workers/40626 (commit 6c476c22) causes multiple test failures
- X-seq: zsh-workers 40650
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: workers/40626 (commit 6c476c22) causes multiple test failures
- Date: Sun, 26 Feb 2017 11:42:16 -0800
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=1852MW0diI6pconp6yH/OZb17dfnHxqdLM5Cp8lFJcM=; b=GnGjzERuCgtuhJMQiF99n/HIBPTKLOvboi23cztyVi7DfINbjUNYK9qKjt9BvRCcc+ j+t0Wn9qwueNB8tG30I9A6f0R/VQlysPOhhK1MXZM5f4zMEM1SCIZ2NHL7LqfBcMqdzg lCJkXKGbpCh+4kPt78LUJeZY+6fqo4kz02ILHusp1OxW8xFXTPTWzWYvC0pPaEK0JB07 slLdfrUJL9tKurX+0azRp8x5HAUbgR5mkcwY80Y/8tChezF9BJeoVASNhHLxte33Xo9k 8nJKf1v8rnyEHIjFm6SlGQvprCZ7pIIdPtHhBni0J8dWb+IxH1Y+CgqxZqQJoFxeUBbs m97A==
- In-reply-to: <20170226061620.GA3729@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <170225160455.ZM15040@torch.brasslantern.com> <20170226061620.GA3729@fujitsu.shahaf.local2>
On Feb 26, 6:16am, Daniel Shahaf wrote:
} Subject: Re: workers/40626 (commit 6c476c22) causes multiple test failures
}
} Bart Schaefer wrote on Sat, Feb 25, 2017 at 16:04:55 -0800:
} > This is just the first one that dies:
}
} I could swear 'make check' had passed before I pushed this, but I can
} reproduce this. No time to debug, so reverted. Sorry for the breakage.
workers/40508 always seemed questionable to me.
I suspect this is what comes of some attempt to optimize assignments.
There may be cases where the recopy operation in these set*() functions
is redundant, but I don't feel like tracking that down just now; it is
definitely necessary for $options, so ...
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index c251e4f..10c47d2 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -167,7 +167,7 @@ unsetpmcommand(Param pm, UNUSED(int exp))
/**/
static void
-setpmcommands(UNUSED(Param pm), HashTable ht)
+setpmcommands(Param pm, HashTable ht)
{
int i;
HashNode hn;
@@ -190,7 +190,15 @@ setpmcommands(UNUSED(Param pm), HashTable ht)
cmdnamtab->addnode(cmdnamtab, ztrdup(hn->nam), &cn->node);
}
- deleteparamtable(ht);
+ /*
+ * On full-array assignment ht is a temporary hash with the default
+ * get/set functions, whereas pm->u.hash has the special $commands
+ * get/set functions. Do not assign ht to pm, just delete it.
+ *
+ * On append, ht and pm->u.hash are the same table, don't delete.
+ */
+ if (ht != pm->u.hash)
+ deleteparamtable(ht);
}
static const struct gsu_scalar pmcommand_gsu =
@@ -349,7 +357,9 @@ setfunctions(Param pm, HashTable ht, int dis)
setfunction(hn->nam, ztrdup(getstrvalue(&v)), dis);
}
- hashsetfn(pm, ht);
+ /* See setpmcommands() above */
+ if (ht != pm->u.hash)
+ deleteparamtable(ht);
}
/**/
@@ -937,7 +947,7 @@ unsetpmoption(Param pm, UNUSED(int exp))
/**/
static void
-setpmoptions(UNUSED(Param pm), HashTable ht)
+setpmoptions(Param pm, HashTable ht)
{
int i;
HashNode hn;
@@ -962,7 +972,9 @@ setpmoptions(UNUSED(Param pm), HashTable ht)
(val && strcmp(val, "off")), 0, opts))
zwarn("can't change option: %s", hn->nam);
}
- deleteparamtable(ht);
+ /* See setpmcommands() above */
+ if (ht != pm->u.hash)
+ deleteparamtable(ht);
}
static const struct gsu_scalar pmoption_gsu =
@@ -1501,7 +1513,7 @@ unsetpmnameddir(Param pm, UNUSED(int exp))
/**/
static void
-setpmnameddirs(UNUSED(Param pm), HashTable ht)
+setpmnameddirs(Param pm, HashTable ht)
{
int i;
HashNode hn, next, hd;
@@ -1543,7 +1555,9 @@ setpmnameddirs(UNUSED(Param pm), HashTable ht)
i = opts[INTERACTIVE];
opts[INTERACTIVE] = 0;
- deleteparamtable(ht);
+ /* See setpmcommands() above */
+ if (ht != pm->u.hash)
+ deleteparamtable(ht);
opts[INTERACTIVE] = i;
}
@@ -1724,7 +1738,7 @@ unsetpmsalias(Param pm, UNUSED(int exp))
/**/
static void
-setaliases(HashTable alht, UNUSED(Param pm), HashTable ht, int flags)
+setaliases(HashTable alht, Param pm, HashTable ht, int flags)
{
int i;
HashNode hn, next, hd;
@@ -1760,7 +1774,9 @@ setaliases(HashTable alht, UNUSED(Param pm), HashTable ht, int flags)
alht->addnode(alht, ztrdup(hn->nam),
createaliasnode(ztrdup(val), flags));
}
- deleteparamtable(ht);
+ /* See setpmcommands() above */
+ if (ht != pm->u.hash)
+ deleteparamtable(ht);
}
/**/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author