summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index f49a07f1a..7ac33b912 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2591,8 +2591,15 @@ assignsparam(char *s, char *val, int flags)
 	*ss = '\0';
 	if (!(v = getvalue(&vbuf, &s, 1)))
 	    createparam(t, PM_ARRAY);
-	else
+	else {
+	    if (v->pm->node.flags & PM_READONLY) {
+		zerr("read-only variable: %s", v->pm->node.nam);
+		*ss = '[';
+		zsfree(val);
+		return NULL;
+	    }
 	    flags &= ~ASSPM_WARN_CREATE;
+	}
 	*ss = '[';
 	v = NULL;
     } else {