diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-01-20 22:20:47 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-01-20 22:20:47 +0200 |
commit | 9a0812e1b5ed67c3e75e70749a7e2a54f9c2bfcc (patch) | |
tree | f7924aeb58a0b721e91f1127c92e18b3fbf3e54e /interpret.h | |
parent | a6ece4a82072150e4b269b5698bb8caf14075bcb (diff) | |
parent | 5766636f7bb7eb6d8fa9fd1b097ca74329062173 (diff) | |
download | egawk-9a0812e1b5ed67c3e75e70749a7e2a54f9c2bfcc.tar.gz egawk-9a0812e1b5ed67c3e75e70749a7e2a54f9c2bfcc.tar.bz2 egawk-9a0812e1b5ed67c3e75e70749a7e2a54f9c2bfcc.zip |
Merge branch 'master' into feature/fix-ns-memleak
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/interpret.h b/interpret.h index 82329e85..e9896672 100644 --- a/interpret.h +++ b/interpret.h @@ -303,22 +303,16 @@ 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); - } + } else + DEREF(t2); - DEREF(t2); PUSH(r); break; |