use StringToNumEnd() for check of numeric keys
[nedit-bw.git] / EXEC_ERROR.patch
blob844b91e72fb84358976f3e0af75c66f8f86c9cdc
1 ---
3 source/interpret.c | 192 +++++++++++++++++++++++++++--------------------------
4 1 file changed, 98 insertions(+), 94 deletions(-)
6 diff --quilt old/source/interpret.c new/source/interpret.c
7 --- old/source/interpret.c
8 +++ new/source/interpret.c
9 @@ -1375,10 +1375,12 @@ static void addToGlobalSymTab(Symbol *sy
10 GlobalSymTab[idx] = sym;
13 +#define EXEC_ERROR(s1, s2) return execError(s1, s2)
15 #define GET_SYM(s) \
16 do { \
17 if (PC->type != SYM_INST) { \
18 - return execError("Unexpected instruction, expected <symbol>: <%s>", \
19 + EXEC_ERROR("Unexpected instruction, expected <symbol>: <%s>", \
20 instTypeToStr(PC->type)); \
21 } \
22 s = PC->val.sym; \
23 @@ -1388,7 +1390,7 @@ static void addToGlobalSymTab(Symbol *sy
24 #define GET_IMMED(i) \
25 do { \
26 if (PC->type != IMMED_INST) { \
27 - return execError("Unexpected instruction, expected <immediate>: <%s>", \
28 + EXEC_ERROR("Unexpected instruction, expected <immediate>: <%s>", \
29 instTypeToStr(PC->type)); \
30 } \
31 i = PC->val.immed; \
32 @@ -1398,7 +1400,7 @@ static void addToGlobalSymTab(Symbol *sy
33 #define GET_BRANCH(a) \
34 do { \
35 if (PC->type != BRANCH_INST) { \
36 - return execError("Unexpected instruction, expected <branch>: <%s>", \
37 + EXEC_ERROR("Unexpected instruction, expected <branch>: <%s>", \
38 instTypeToStr(PC->type)); \
39 } \
40 a = PC + PC->val.branch; \
41 @@ -1439,7 +1441,7 @@ static void addToGlobalSymTab(Symbol *sy
42 #define POP_CHECK(n) \
43 do { \
44 if (!OK_TO_POP(n)) { \
45 - return execError(StackUnderflowMsg, ""); \
46 + EXEC_ERROR(StackUnderflowMsg, ""); \
47 } \
48 } while (0)
50 @@ -1450,17 +1452,17 @@ static void addToGlobalSymTab(Symbol *sy
51 #define PUSH_CHECK(n) \
52 do { \
53 if (!OK_TO_PUSH(n)) { \
54 - return execError(StackOverflowMsg, ""); \
55 + EXEC_ERROR(StackOverflowMsg, ""); \
56 } \
57 } while (0)
59 #define PEEK_CHECK(n) \
60 do { \
61 if (!OK_TO_POP((n) + 1)) { \
62 - return execError(StackUnderflowMsg, ""); \
63 + EXEC_ERROR(StackUnderflowMsg, ""); \
64 } \
65 if (!OK_TO_PUSH(-(n))) { \
66 - return execError(StackOverflowMsg, ""); \
67 + EXEC_ERROR(StackOverflowMsg, ""); \
68 } \
69 } while (0)
71 @@ -1489,10 +1491,10 @@ static void addToGlobalSymTab(Symbol *sy
72 __int = dataVal.val.n; \
73 } else if (dataVal.tag == STRING_TAG) { \
74 if (!StringToNum(dataVal.val.str.rep, &__int)) {\
75 - return execError(StringToNumberMsg, dataVal.val.str.rep); \
76 + EXEC_ERROR(StringToNumberMsg, dataVal.val.str.rep); \
77 } \
78 } else { \
79 - return execError("incompatible type in integer context: <%s>", \
80 + EXEC_ERROR("incompatible type in integer context: <%s>", \
81 tagToStr(dataVal.tag)); \
82 } \
83 number = __int; \
84 @@ -1506,7 +1508,7 @@ static void addToGlobalSymTab(Symbol *sy
85 } else if (dataVal.tag == INT_TAG) { \
86 __str = AllocStringOfNumber(dataVal.val.n); \
87 } else { \
88 - return execError("incompatible type in string context: <%s>", \
89 + EXEC_ERROR("incompatible type in string context: <%s>", \
90 tagToStr(dataVal.tag)); \
91 } \
92 string = __str; \
93 @@ -1604,7 +1606,7 @@ static int pushSymVal(void)
94 nArgs = FRAME_GET_ARG_COUNT();
95 argNum = s->value.val.n;
96 if (argNum >= nArgs) {
97 - return execError("referenced undefined argument: %s", s->name);
98 + EXEC_ERROR("referenced undefined argument: %s", s->name);
100 if (argNum == N_ARGS_ARG_SYM) {
101 symVal.tag = INT_TAG;
102 @@ -1617,7 +1619,7 @@ static int pushSymVal(void)
103 char *errMsg;
104 if (!(s->value.val.subr)(FocusWindow, NULL, 0,
105 &symVal, &errMsg)) {
106 - return execError(errMsg, s->name);
107 + EXEC_ERROR(errMsg, s->name);
109 } else if (s->type == C_FUNCTION_SYM
110 || s->type == MACRO_FUNCTION_SYM
111 @@ -1625,9 +1627,9 @@ static int pushSymVal(void)
112 symVal.tag = SUBR_TAG;
113 symVal.val.sym = s;
114 } else
115 - return execError("reading non-variable: %s", s->name);
116 + EXEC_ERROR("reading non-variable: %s", s->name);
117 if (symVal.tag == NO_TAG && !inTypeOfMode) {
118 - return execError("variable not set: %s", s->name);
119 + EXEC_ERROR("variable not set: %s", s->name);
122 PUSH(symVal);
123 @@ -1667,8 +1669,8 @@ static int pushArgVal(void)
124 --argNum;
125 nArgs = FRAME_GET_ARG_COUNT();
126 if (argNum >= nArgs || argNum < 0) {
127 - return execError("referenced undefined argument: $args[%s]",
128 - longAsStr(argNum + 1));
129 + EXEC_ERROR("referenced undefined argument: $args[%s]",
130 + longAsStr(argNum + 1));
132 PUSH(FRAME_GET_ARG_N(argNum));
133 return STAT_OK;
134 @@ -1707,7 +1709,7 @@ static int pushArgArray(void)
135 argVal = FRAME_GET_ARG_N(argNum);
136 if (!ArrayInsert(argArray, AllocStringOfNumber(argNum + 1),
137 &argVal)) {
138 - return(execError("argument array insertion failure", NULL));
139 + EXEC_ERROR("argument array insertion failure", NULL);
143 @@ -1743,7 +1745,7 @@ static int pushArraySymVal(void)
144 dataPtr = &sym->value;
146 else {
147 - return execError("assigning to non-lvalue array or non-array: %s", sym->name);
148 + EXEC_ERROR("assigning to non-lvalue array or non-array: %s", sym->name);
151 if (initEmpty && dataPtr->tag == NO_TAG) {
152 @@ -1752,7 +1754,7 @@ static int pushArraySymVal(void)
155 if (dataPtr->tag == NO_TAG && !inTypeOfMode) {
156 - return execError("variable not set: %s", sym->name);
157 + EXEC_ERROR("variable not set: %s", sym->name);
160 PUSH(*dataPtr);
161 @@ -1845,7 +1847,7 @@ static int anonArrayNextVal(void)
163 sprintf(numString, "%d", nextIndex);
164 if (!ArrayInsert(&anonArray, AllocStringCpy(numString), &exprVal)) {
165 - return(execError("array insertion failure", NULL));
166 + EXEC_ERROR("array insertion failure", NULL);
169 /* we need to increment the index for next time */
170 @@ -1897,7 +1899,7 @@ static int anonArrayIndexVal(void)
173 if (!ArrayInsert(&anonArray, keyString, &exprVal)) {
174 - return(execError("array insertion failure", NULL));
175 + EXEC_ERROR("array insertion failure", NULL);
178 /* push the default next index value first, then the array */
179 @@ -1988,7 +1990,7 @@ static int namedArg1orN(Boolean isFirst)
180 /* if our index is numeric (or can be converted to a number) we must
181 change the next index value */
182 if (nDim == 1 && StringToNum(keyString, &index)) {
183 - return execError("named argument name must not be numeric", NULL);
184 + EXEC_ERROR("named argument name must not be numeric", NULL);
187 if (isFirst) {
188 @@ -2002,7 +2004,7 @@ static int namedArg1orN(Boolean isFirst)
191 if (!ArrayInsert(&argsArray, keyString, &exprVal)) {
192 - return(execError("named argument insertion failure", NULL));
193 + EXEC_ERROR("named argument insertion failure", NULL);
196 /* and (re)push the array */
197 @@ -2050,13 +2052,13 @@ static int assign(void)
199 if (sym->type != GLOBAL_SYM && sym->type != LOCAL_SYM) {
200 if (sym->type == ARG_SYM) {
201 - return execError("assignment to function argument: %s", sym->name);
202 + EXEC_ERROR("assignment to function argument: %s", sym->name);
204 else if (sym->type == PROC_VALUE_SYM) {
205 - return execError("assignment to read-only variable: %s", sym->name);
206 + EXEC_ERROR("assignment to read-only variable: %s", sym->name);
208 else {
209 - return execError("assignment to non-variable: %s", sym->name);
210 + EXEC_ERROR("assignment to non-variable: %s", sym->name);
214 @@ -2172,13 +2174,13 @@ static int add(void)
215 rightIter = arrayIterateNext(rightIter);
217 if (!insertResult) {
218 - return(execError("array insertion failure", NULL));
219 + EXEC_ERROR("array insertion failure", NULL);
222 PUSH(resultArray);
224 else {
225 - return(execError("can't mix math with arrays and non-arrays", NULL));
226 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
229 else {
230 @@ -2186,7 +2188,7 @@ static int add(void)
231 POP_INT(n1);
232 PUSH_INT(n1 + n2);
234 - return(STAT_OK);
235 + return STAT_OK;
239 @@ -2238,13 +2240,13 @@ static int subtract(void)
240 leftIter = arrayIterateNext(leftIter);
242 if (!insertResult) {
243 - return(execError("array insertion failure", NULL));
244 + EXEC_ERROR("array insertion failure", NULL);
247 PUSH(resultArray);
249 else {
250 - return(execError("can't mix math with arrays and non-arrays", NULL));
251 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
254 else {
255 @@ -2252,7 +2254,7 @@ static int subtract(void)
256 POP_INT(n1);
257 PUSH_INT(n1 - n2);
259 - return(STAT_OK);
260 + return STAT_OK;
264 @@ -2279,7 +2281,7 @@ static int divide(void)
265 POP_INT(n2);
266 POP_INT(n1);
267 if (n2 == 0) {
268 - return execError("division by zero", "");
269 + EXEC_ERROR("division by zero", "");
271 PUSH_INT(n1 / n2);
272 return STAT_OK;
273 @@ -2295,7 +2297,7 @@ static int modulo(void)
274 POP_INT(n2);
275 POP_INT(n1);
276 if (n2 == 0) {
277 - return execError("modulo by zero", "");
278 + EXEC_ERROR("modulo by zero", "");
280 PUSH_INT(n1 % n2);
281 return STAT_OK;
282 @@ -2376,11 +2378,11 @@ static int eq(void)
285 else {
286 - return(execError("incompatible types to compare", NULL));
287 + EXEC_ERROR("incompatible types to compare", NULL);
289 v1.tag = INT_TAG;
290 PUSH(v1);
291 - return(STAT_OK);
292 + return STAT_OK;
295 /* negated eq() call */
296 @@ -2433,13 +2435,13 @@ static int bitAnd(void)
297 rightIter = arrayIterateNext(rightIter);
299 if (!insertResult) {
300 - return(execError("array insertion failure", NULL));
301 + EXEC_ERROR("array insertion failure", NULL);
304 PUSH(resultArray);
306 else {
307 - return(execError("can't mix math with arrays and non-arrays", NULL));
308 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
311 else {
312 @@ -2447,7 +2449,7 @@ static int bitAnd(void)
313 POP_INT(n1);
314 PUSH_INT(n1 & n2);
316 - return(STAT_OK);
317 + return STAT_OK;
321 @@ -2504,13 +2506,13 @@ static int bitOr(void)
322 rightIter = arrayIterateNext(rightIter);
324 if (!insertResult) {
325 - return(execError("array insertion failure", NULL));
326 + EXEC_ERROR("array insertion failure", NULL);
329 PUSH(resultArray);
331 else {
332 - return(execError("can't mix math with arrays and non-arrays", NULL));
333 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
336 else {
337 @@ -2518,7 +2520,7 @@ static int bitOr(void)
338 POP_INT(n1);
339 PUSH_INT(n1 | n2);
341 - return(STAT_OK);
342 + return STAT_OK;
345 static int and(void)
346 @@ -2618,7 +2620,7 @@ static int concatenateNwithSep(int nVals
347 len += value.val.str.len;
349 else {
350 - return execError("incompatible type in string context: <%s>",
351 + EXEC_ERROR("incompatible type in string context: <%s>",
352 tagToStr(value.tag));
355 @@ -2735,7 +2737,8 @@ static int callSubroutineFromSymbol(Symb
356 if (symValPtr->tag == SUBR_TAG) {
357 sym = symValPtr->val.sym;
358 } else {
359 - return execError("%s is not a variable holding a subroutine pointer", sym->name);
360 + EXEC_ERROR("%s is not a variable holding a subroutine pointer",
361 + sym->name);
365 @@ -2754,7 +2757,7 @@ static int callSubroutineFromSymbol(Symb
366 PreemptRequest = False;
367 if (!sym->value.val.subr(FocusWindow, StackP,
368 nArgs, &result, &errMsg))
369 - return execError(errMsg, sym->name);
370 + EXEC_ERROR(errMsg, sym->name);
371 PUSH_RET_VAL(result);
372 return PreemptRequest ? STAT_PREEMPT : STAT_OK;
374 @@ -2789,8 +2792,7 @@ static int callSubroutineFromSymbol(Symb
375 Window win;
377 if (haveNamedArgs) {
378 - return execError(
379 - "%s action routine called with named argument array",
380 + EXEC_ERROR("%s action routine called with named argument array",
381 sym->name);
384 @@ -2826,7 +2828,7 @@ static int callSubroutineFromSymbol(Symb
387 /* Calling a non subroutine symbol */
388 - return execError("%s is not a function or subroutine", sym->name);
389 + EXEC_ERROR("%s is not a function or subroutine", sym->name);
393 @@ -2896,7 +2898,7 @@ static int callSubroutineUnpackArray(voi
394 POP(argArray);
396 if (argArray.tag != ARRAY_TAG) {
397 - return execError("argument array call made with non-array value", NULL);
398 + EXEC_ERROR("argument array call made with non-array value", NULL);
401 if (haveNamedArgs) {
402 @@ -2930,7 +2932,7 @@ static int callSubroutineUnpackArray(voi
404 else {
405 if (!ArrayInsert(&dvArray, iter->key, &dvEntry)) {
406 - return(execError("array copy failed", NULL));
407 + EXEC_ERROR("array copy failed", NULL);
411 @@ -3016,7 +3018,7 @@ int OverlayRoutineFromProg(Program *prog
413 static int fetchRetVal(void)
415 - return execError("internal error: frv", NULL);
416 + EXEC_ERROR("internal error: frv", NULL);
419 /* see comments for returnValOrNone() */
420 @@ -3156,17 +3158,17 @@ int ArrayCopy(DataValue *dstArray, DataV
421 return(errNum);
423 if (!ArrayInsert(dstArray, srcIter->key, &tmpArray)) {
424 - return(execError("array copy failed", NULL));
425 + return STAT_ERROR;
428 else {
429 if (!ArrayInsert(dstArray, srcIter->key, &srcIter->value)) {
430 - return(execError("array copy failed", NULL));
431 + return STAT_ERROR;
434 srcIter = arrayIterateNext(srcIter);
436 - return(STAT_OK);
437 + return STAT_OK;
441 @@ -3186,7 +3188,7 @@ static int makeArrayKeyFromArgs(int nArg
442 if (len > 0) {
443 return len;
445 - return(STAT_OK);
446 + return STAT_OK;
450 @@ -3505,23 +3507,24 @@ static int arrayRef(void)
451 POP(srcArray);
452 if (srcArray.tag == ARRAY_TAG) {
453 if (!ArrayGet(&srcArray, keyString, &valueItem)) {
454 - return(execError("referenced array value not in array: %s", keyString));
455 + EXEC_ERROR("referenced array value not in array: %s",
456 + keyString);
458 PUSH(valueItem);
459 - return(STAT_OK);
460 + return STAT_OK;
462 else {
463 - return(execError("operator [] on non-array", NULL));
464 + EXEC_ERROR("operator [] on non-array", NULL);
467 else {
468 POP(srcArray);
469 if (srcArray.tag == ARRAY_TAG) {
470 PUSH_INT(ArraySize(&srcArray));
471 - return(STAT_OK);
472 + return STAT_OK;
474 else {
475 - return(execError("operator [] on non-array", NULL));
476 + EXEC_ERROR("operator [] on non-array", NULL);
480 @@ -3558,7 +3561,7 @@ static int arrayAssign(void)
481 POP(dstArray);
483 if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) {
484 - return(execError("cannot assign array element of non-array", NULL));
485 + EXEC_ERROR("cannot assign array element of non-array", NULL);
487 if (srcValue.tag == ARRAY_TAG) {
488 DataValue arrayCopyValue;
489 @@ -3570,13 +3573,13 @@ static int arrayAssign(void)
492 if (ArrayInsert(&dstArray, keyString, &srcValue)) {
493 - return(STAT_OK);
494 + return STAT_OK;
496 else {
497 - return(execError("array member allocation failure", NULL));
498 + EXEC_ERROR("array member allocation failure", NULL);
501 - return(execError("empty operator []", NULL));
502 + EXEC_ERROR("empty operator []", NULL);
506 @@ -3614,20 +3617,21 @@ static int arrayRefAndAssignSetup(void)
507 PEEK(srcArray, nDim);
508 if (srcArray.tag == ARRAY_TAG) {
509 if (!ArrayGet(&srcArray, keyString, &valueItem)) {
510 - return(execError("referenced array value not in array: %s", keyString));
511 + EXEC_ERROR("referenced array value not in array: %s",
512 + keyString);
514 PUSH(valueItem);
515 if (binaryOp) {
516 PUSH(moveExpr);
518 - return(STAT_OK);
519 + return STAT_OK;
521 else {
522 - return(execError("operator [] on non-array", NULL));
523 + EXEC_ERROR("operator [] on non-array", NULL);
526 else {
527 - return(execError("array[] not an lvalue", NULL));
528 + EXEC_ERROR("array[] not an lvalue", NULL);
532 @@ -3660,16 +3664,16 @@ static int beginArrayIter(void)
533 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
535 else {
536 - return(execError("bad temporary iterator: %s", iterator->name));
537 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
540 iteratorValPtr->tag = INT_TAG;
541 if (arrayVal.tag != ARRAY_TAG) {
542 - return(execError("can't iterate non-array", NULL));
543 + EXEC_ERROR("can't iterate non-array", NULL);
546 iteratorValPtr->val.arrayPtr = arrayIterateFirst(&arrayVal);
547 - return(STAT_OK);
548 + return STAT_OK;
552 @@ -3726,7 +3730,7 @@ static int arrayIter(void)
553 keyValPtr = &(keySym->value);
555 else {
556 - return(execError("can't assign to: %s", keySym->name));
557 + EXEC_ERROR("can't assign to: %s", keySym->name);
559 keyValPtr->tag = NO_TAG;
561 @@ -3738,7 +3742,7 @@ static int arrayIter(void)
562 valPtr = &(valSym->value);
564 else {
565 - return(execError("can't assign to: %s", valSym->name));
566 + EXEC_ERROR("can't assign to: %s", valSym->name);
568 valPtr->tag = NO_TAG;
570 @@ -3747,7 +3751,7 @@ static int arrayIter(void)
571 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
573 else {
574 - return(execError("bad temporary iterator: %s", iterator->name));
575 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
578 thisEntry = iteratorValPtr->val.arrayPtr;
579 @@ -3768,7 +3772,7 @@ static int arrayIter(void)
580 else {
581 JUMP(branchAddr);
583 - return(STAT_OK);
584 + return STAT_OK;
588 @@ -3796,21 +3800,21 @@ static int beginArrayIterArray(void)
589 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
591 else {
592 - return(execError("bad temporary iterator: %s", iterator->name));
593 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
596 if (nDims < 0) {
597 - return(execError("bad multi dimension", NULL));
598 + EXEC_ERROR("bad multi dimension", NULL);
601 iteratorValPtr->tag = INT_TAG;
602 if (arrayVal.tag != ARRAY_TAG) {
603 - return(execError("can't iterate non-array", NULL));
604 + EXEC_ERROR("can't iterate non-array", NULL);
607 iteratorValPtr->val.arrayPtr = arrayIterateFirst(&arrayVal);
609 - return(STAT_OK);
610 + return STAT_OK;
613 static int countDim(const char *key)
614 @@ -3906,7 +3910,7 @@ static int arrayIterArray(void)
615 keyArrayPtr = &(keyArraySym->value);
617 else {
618 - return(execError("can't assign to: %s", keyArraySym->name));
619 + EXEC_ERROR("can't assign to: %s", keyArraySym->name);
621 keyArrayPtr->tag = ARRAY_TAG;
622 keyArrayPtr->val.arrayPtr = NULL;
623 @@ -3919,7 +3923,7 @@ static int arrayIterArray(void)
624 valPtr = &valSym->value;
626 else {
627 - return(execError("can't assign to: %s", valSym->name));
628 + EXEC_ERROR("can't assign to: %s", valSym->name);
630 valPtr->tag = NO_TAG;
632 @@ -3928,7 +3932,7 @@ static int arrayIterArray(void)
633 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
635 else {
636 - return(execError("bad temporary iterator: %s", iterator->name));
637 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
640 thisEntry = iteratorValPtr->val.arrayPtr;
641 @@ -3949,7 +3953,7 @@ static int arrayIterArray(void)
643 /* set keys */
644 if (!splitKeyIntoArray(thisEntry->key, keyArrayPtr)) {
645 - return(execError("can't split key: %s", thisEntry->key));
646 + EXEC_ERROR("can't split key: %s", thisEntry->key);
649 if (withVal) {
650 @@ -3993,7 +3997,7 @@ static int inArray(void)
652 POP(theArray);
653 if (theArray.tag != ARRAY_TAG) {
654 - return(execError("operator in on non-array", NULL));
655 + EXEC_ERROR("operator in on non-array", NULL);
657 PEEK(leftArray, 0);
658 if (leftArray.tag == ARRAY_TAG) {
659 @@ -4014,7 +4018,7 @@ static int inArray(void)
662 PUSH_INT(inResult);
663 - return(STAT_OK);
664 + return STAT_OK;
668 @@ -4057,15 +4061,15 @@ static int deleteArrayElement(void)
671 else {
672 - return(execError("attempt to delete from non-array", NULL));
673 + EXEC_ERROR("attempt to delete from non-array", NULL);
675 - return(STAT_OK);
676 + return STAT_OK;
679 static int typeOfIn(void)
681 if (inTypeOfMode) {
682 - return(execError("I'm already in typeof-mode", NULL));
683 + EXEC_ERROR("I'm already in typeof-mode", NULL);
686 inTypeOfMode = 1;
687 @@ -4079,7 +4083,7 @@ static int typeOfOut(void)
688 DataValue retVal;
690 if (!inTypeOfMode) {
691 - return(execError("I'm not in typeof-mode", NULL));
692 + EXEC_ERROR("I'm not in typeof-mode", NULL);
695 inTypeOfMode = 0;
696 @@ -4133,7 +4137,7 @@ static int arrayAssignNext(void)
697 POP(dstArray);
699 if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) {
700 - return execError("cannot assign array element of non-array", NULL);
701 + EXEC_ERROR("cannot assign array element of non-array", NULL);
704 if (srcValue.tag == ARRAY_TAG) {
705 @@ -4149,7 +4153,7 @@ static int arrayAssignNext(void)
706 keyString = AllocStringOfNumber(arrayMaxNumIdx(&dstArray) + 1);
708 if (!ArrayInsert(&dstArray, keyString, &srcValue)) {
709 - return execError("array member allocation failure", NULL);
710 + EXEC_ERROR("array member allocation failure", NULL);
713 return STAT_OK;
714 @@ -4173,7 +4177,7 @@ static int arrayNextNumIdx(void)
716 POP(srcArray);
717 if (srcArray.tag != ARRAY_TAG) {
718 - return execError("operator [@] on non-array", NULL);
719 + EXEC_ERROR("operator [@] on non-array", NULL);
722 PUSH_INT(arrayMaxNumIdx(&srcArray) + 1);
723 @@ -4188,9 +4192,9 @@ static int arrayNextNumIdx(void)
724 static int errCheck(const char *s)
726 if (errno == EDOM)
727 - return execError("%s argument out of domain", s);
728 + EXEC_ERROR("%s argument out of domain", s);
729 else if (errno == ERANGE)
730 - return execError("%s result out of range", s);
731 + EXEC_ERROR("%s result out of range", s);
732 else
733 return STAT_OK;