3 source/interpret.c | 14 +++++++++++---
4 1 files changed, 11 insertions(+), 3 deletions(-)
6 diff --quilt old/source/interpret.c new/source/interpret.c
7 --- old/source/interpret.c
8 +++ new/source/interpret.c
9 @@ -2619,27 +2619,35 @@ int OverlayRoutineFromProg(Program *prog
10 ** After: Prog-> next, ...
11 ** Stack-> -(nArgs+1), argArray, argN-arg1, next, ...
13 static int unpackArrayToArgs(void)
18 DataValue dvEntry, dvArray;
26 if (dvArray.tag != ARRAY_TAG) {
27 return execError("argument array call made with non-array value", NULL);
30 + res = ArrayCopy(&dvArray, &dvEntry);
31 + if (res != STAT_OK) {
32 + return execError("cannot copy array in array call", NULL);
35 /* push positional argument entries in the array on the stack */
36 for (nArgs = 1; ; ++nArgs) {
37 - if (!ArrayGet(&dvArray, (char *)longAsStr(nArgs), &dvEntry))
38 + char *key = (char *)longAsStr(nArgs);
39 + if (!ArrayGet(&dvArray, key, &dvEntry))
41 + /* remove them from remaining array */
42 + ArrayDelete(&dvArray, key);