[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1069-g444afe
From: |
Andrew J. Schorr |
Subject: |
[gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1069-g444afe9 |
Date: |
Wed, 07 Jan 2015 02:28:35 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, select has been updated
via 444afe9e4a9c70f0833f6a0a912651dd0d0e57aa (commit)
from f38a8f801496ea91cef7a8507e2919f6586d0694 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=444afe9e4a9c70f0833f6a0a912651dd0d0e57aa
commit 444afe9e4a9c70f0833f6a0a912651dd0d0e57aa
Author: Andrew J. Schorr <address@hidden>
Date: Tue Jan 6 21:28:12 2015 -0500
The API should call the astore hook after array assignment.
diff --git a/ChangeLog b/ChangeLog
index 71268d3..e3a194d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-01-06 Andrew J. Schorr <address@hidden>
+ * gawkapi.c (api_sym_update): If copying a subarray, must update
+ the parent_array pointer. Also, call the astore hook if non-NULL.
+ (api_set_array_element): Call the astore hook if non-NULL.
+
+2015-01-06 Andrew J. Schorr <address@hidden>
+
* awk.h (variable_create): Now takes a 3rd argument to tell caller
whether this is a deferred variable.
* awkgram.y (variable_create): Return indicator of whether this is
diff --git a/gawkapi.c b/gawkapi.c
index e887902..371a375 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -605,10 +605,15 @@ api_sym_update(awk_ext_id_t id,
list = array_node->alist(array_node, & akind);
for (i = 0; i < nel; i++) {
NODE **aptr;
+ NODE *elem;
aptr = assoc_lookup(node, list[2*i]);
unref(*aptr);
+ elem = *aptr = dupnode(list[2*i+1]);
+ if (elem->type == Node_var_array)
+ elem->parent_array = node;
+ if (node->astore != NULL)
+ (*node->astore)(node,
list[2*i]);
unref(list[2*i]); /* alist duped it */
- *aptr = dupnode(list[2*i+1]);
}
efree(list);
assoc_clear(array_node);
@@ -820,7 +825,6 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie,
tmp = awk_value_to_node(index);
aptr = assoc_lookup(array, tmp);
- unref(tmp);
unref(*aptr);
elem = *aptr = awk_value_to_node(value);
if (elem->type == Node_var_array) {
@@ -829,6 +833,9 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie,
index->str_value.len);
make_aname(elem);
}
+ if (array->astore != NULL)
+ (*array->astore)(array, tmp);
+ unref(tmp);
return awk_true;
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
gawkapi.c | 11 +++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, select, updated. gawk-4.1.0-1069-g444afe9,
Andrew J. Schorr <=