From c73d262642ee3a3d6585dc44acc62c432910f920 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 15 Jan 2019 21:27:06 +0200 Subject: Finish transition to using assoc_set. --- interpret.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'interpret.h') diff --git a/interpret.h b/interpret.h index 82329e85..53abadcb 100644 --- a/interpret.h +++ b/interpret.h @@ -303,22 +303,15 @@ uninitialized_scalar: if (r == NULL) { r = make_array(); r->parent_array = t1; - lhs = assoc_lookup(t1, t2); - unref(*lhs); - *lhs = r; t2 = force_string(t2); r->vname = estrdup(t2->stptr, t2->stlen); /* the subscript in parent array */ - - /* execute post-assignment routine if any */ - if (t1->astore != NULL) - (*t1->astore)(t1, t2); + assoc_set(t1, t2, r); } else if (r->type != Node_var_array) { t2 = force_string(t2); fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"), array_vname(t1), (int) t2->stlen, t2->stptr); } - DEREF(t2); PUSH(r); break; -- cgit v1.2.3 From 5766636f7bb7eb6d8fa9fd1b097ca74329062173 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 20 Jan 2019 21:42:36 +0200 Subject: Cleanups for assoc_set. --- interpret.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'interpret.h') diff --git a/interpret.h b/interpret.h index 53abadcb..e9896672 100644 --- a/interpret.h +++ b/interpret.h @@ -310,7 +310,8 @@ uninitialized_scalar: t2 = force_string(t2); fatal(_("attempt to use scalar `%s[\"%.*s\"]' as an array"), array_vname(t1), (int) t2->stlen, t2->stptr); - } + } else + DEREF(t2); PUSH(r); break; -- cgit v1.2.3