From d27ea2ae02275b255f9efbf929d1dc7932aebc57 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 4 Mar 2024 21:36:45 -0800 Subject: unposted (cf. 52617): only scalars can instantiate a declared named reference --- Src/params.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/params.c b/Src/params.c index 263cd0c52..4bcf41c22 100644 --- a/Src/params.c +++ b/Src/params.c @@ -1050,8 +1050,14 @@ createparam(char *name, int flags) name = refname; oldpm = NULL; } else { - if (!(lastpm->node.flags & PM_READONLY)) - lastpm->node.flags |= PM_UNSET; + if (!(lastpm->node.flags & PM_READONLY)) { + if (flags) { + /* Only plain scalar assignment allowed */ + zerr("%s: can't change type of named reference", + name); /* Differs from ksh93u+ */ + return NULL; + } + } return lastpm; } } else { -- cgit 1.4.1