about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/params.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f62ce1c8..e23364272 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-11-30  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 37254: Src/params.c: No functional change: change code layout
+	in preparation for 37253.
+
 	* 37250: Src/params.c: No functional change: rename local
 	variables.
 
diff --git a/Src/params.c b/Src/params.c
index ee1527153..d8bf83d0e 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2537,6 +2537,7 @@ setarrvalue(Value v, char **val)
 	freearray(val);
 	return;
     }
+
     if (v->start == 0 && v->end == -1) {
 	if (PM_TYPE(v->pm->node.flags) == PM_HASHED)
 	    arrhashsetfn(v->pm, val, 0);
@@ -2545,18 +2546,17 @@ setarrvalue(Value v, char **val)
     } else if (v->start == -1 && v->end == 0 &&
     	    PM_TYPE(v->pm->node.flags) == PM_HASHED) {
     	arrhashsetfn(v->pm, val, 1);
+    } else if ((PM_TYPE(v->pm->node.flags) == PM_HASHED)) {
+	freearray(val);
+	zerr("%s: attempt to set slice of associative array",
+	     v->pm->node.nam);
+	return;
     } else {
 	char **old, **new, **p, **q, **r;
 	int pre_assignment_length;
 	int post_assignment_length;
 	int i;
 
-	if ((PM_TYPE(v->pm->node.flags) == PM_HASHED)) {
-	    freearray(val);
-	    zerr("%s: attempt to set slice of associative array",
-		 v->pm->node.nam);
-	    return;
-	}
 	if ((v->flags & VALFLAG_INV) && unset(KSHARRAYS)) {
 	    if (v->start > 0)
 		v->start--;