NULL terminate string bulk list
[nedit-bw.git] / EXEC_ERROR.patch
blob34240e1897fa7ae669337754a96becb42009b7c6
1 ---
3 source/interpret.c | 200 +++++++++++++++++++++++++++--------------------------
4 1 file changed, 102 insertions(+), 98 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,11 +1491,11 @@ 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 - tagToStr(dataVal.tag))); \
81 + EXEC_ERROR("incompatible type in integer context: %s", \
82 + tagToStr(dataVal.tag)); \
83 } \
84 number = __int; \
85 } while (0)
86 @@ -1506,8 +1508,8 @@ static void addToGlobalSymTab(Symbol *sy
87 } else if (dataVal.tag == INT_TAG) { \
88 __str = AllocStringOfNumber(dataVal.val.n); \
89 } else { \
90 - return(execError("incompatible type in string context: %s", \
91 - tagToStr(dataVal.tag))); \
92 + EXEC_ERROR("incompatible type in string context: %s", \
93 + tagToStr(dataVal.tag)); \
94 } \
95 string = __str; \
96 } while (0)
97 @@ -1604,7 +1606,7 @@ static int pushSymVal(void)
98 nArgs = FRAME_GET_ARG_COUNT();
99 argNum = s->value.val.n;
100 if (argNum >= nArgs) {
101 - return execError("referenced undefined argument: %s", s->name);
102 + EXEC_ERROR("referenced undefined argument: %s", s->name);
104 if (argNum == N_ARGS_ARG_SYM) {
105 symVal.tag = INT_TAG;
106 @@ -1617,7 +1619,7 @@ static int pushSymVal(void)
107 char *errMsg;
108 if (!(s->value.val.subr)(FocusWindow, NULL, 0,
109 &symVal, &errMsg)) {
110 - return execError(errMsg, s->name);
111 + EXEC_ERROR(errMsg, s->name);
113 } else if (s->type == C_FUNCTION_SYM
114 || s->type == MACRO_FUNCTION_SYM
115 @@ -1625,9 +1627,9 @@ static int pushSymVal(void)
116 symVal.tag = SUBR_TAG;
117 symVal.val.sym = s;
118 } else
119 - return execError("reading non-variable: %s", s->name);
120 + EXEC_ERROR("reading non-variable: %s", s->name);
121 if (symVal.tag == NO_TAG && !inTypeOfMode) {
122 - return execError("variable not set: %s", s->name);
123 + EXEC_ERROR("variable not set: %s", s->name);
126 PUSH(symVal);
127 @@ -1667,8 +1669,8 @@ static int pushArgVal(void)
128 --argNum;
129 nArgs = FRAME_GET_ARG_COUNT();
130 if (argNum >= nArgs || argNum < 0) {
131 - return execError("referenced undefined argument: $args[%s]",
132 - longAsStr(argNum + 1));
133 + EXEC_ERROR("referenced undefined argument: $args[%s]",
134 + longAsStr(argNum + 1));
136 PUSH(FRAME_GET_ARG_N(argNum));
137 return STAT_OK;
138 @@ -1707,7 +1709,7 @@ static int pushArgArray(void)
139 argVal = FRAME_GET_ARG_N(argNum);
140 if (!ArrayInsert(argArray, AllocStringOfNumber(argNum + 1),
141 &argVal)) {
142 - return(execError("argument array insertion failure", NULL));
143 + EXEC_ERROR("argument array insertion failure", NULL);
147 @@ -1743,7 +1745,7 @@ static int pushArraySymVal(void)
148 dataPtr = &sym->value;
150 else {
151 - return execError("assigning to non-lvalue array or non-array: %s", sym->name);
152 + EXEC_ERROR("assigning to non-lvalue array or non-array: %s", sym->name);
155 if (initEmpty && dataPtr->tag == NO_TAG) {
156 @@ -1752,7 +1754,7 @@ static int pushArraySymVal(void)
159 if (dataPtr->tag == NO_TAG && !inTypeOfMode) {
160 - return execError("variable not set: %s", sym->name);
161 + EXEC_ERROR("variable not set: %s", sym->name);
164 PUSH(*dataPtr);
165 @@ -1845,7 +1847,7 @@ static int anonArrayNextVal(void)
167 sprintf(numString, "%d", nextIndex);
168 if (!ArrayInsert(&anonArray, AllocStringCpy(numString), &exprVal)) {
169 - return(execError("array insertion failure", NULL));
170 + EXEC_ERROR("array insertion failure", NULL);
173 /* we need to increment the index for next time */
174 @@ -1897,7 +1899,7 @@ static int anonArrayIndexVal(void)
177 if (!ArrayInsert(&anonArray, keyString, &exprVal)) {
178 - return(execError("array insertion failure", NULL));
179 + EXEC_ERROR("array insertion failure", NULL);
182 /* push the default next index value first, then the array */
183 @@ -1988,7 +1990,7 @@ static int namedArg1orN(Boolean isFirst)
184 /* if our index is numeric (or can be converted to a number) we must
185 change the next index value */
186 if (nDim == 1 && StringToNum(keyString, &index)) {
187 - return execError("named argument name must not be numeric", NULL);
188 + EXEC_ERROR("named argument name must not be numeric", NULL);
191 if (isFirst) {
192 @@ -2002,7 +2004,7 @@ static int namedArg1orN(Boolean isFirst)
195 if (!ArrayInsert(&argsArray, keyString, &exprVal)) {
196 - return(execError("named argument insertion failure", NULL));
197 + EXEC_ERROR("named argument insertion failure", NULL);
200 /* and (re)push the array */
201 @@ -2050,13 +2052,13 @@ static int assign(void)
203 if (sym->type != GLOBAL_SYM && sym->type != LOCAL_SYM) {
204 if (sym->type == ARG_SYM) {
205 - return execError("assignment to function argument: %s", sym->name);
206 + EXEC_ERROR("assignment to function argument: %s", sym->name);
208 else if (sym->type == PROC_VALUE_SYM) {
209 - return execError("assignment to read-only variable: %s", sym->name);
210 + EXEC_ERROR("assignment to read-only variable: %s", sym->name);
212 else {
213 - return execError("assignment to non-variable: %s", sym->name);
214 + EXEC_ERROR("assignment to non-variable: %s", sym->name);
218 @@ -2172,13 +2174,13 @@ static int add(void)
219 rightIter = arrayIterateNext(rightIter);
221 if (!insertResult) {
222 - return(execError("array insertion failure", NULL));
223 + EXEC_ERROR("array insertion failure", NULL);
226 PUSH(resultArray);
228 else {
229 - return(execError("can't mix math with arrays and non-arrays", NULL));
230 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
233 else {
234 @@ -2186,7 +2188,7 @@ static int add(void)
235 POP_INT(n1);
236 PUSH_INT(n1 + n2);
238 - return(STAT_OK);
239 + return STAT_OK;
243 @@ -2238,13 +2240,13 @@ static int subtract(void)
244 leftIter = arrayIterateNext(leftIter);
246 if (!insertResult) {
247 - return(execError("array insertion failure", NULL));
248 + EXEC_ERROR("array insertion failure", NULL);
251 PUSH(resultArray);
253 else {
254 - return(execError("can't mix math with arrays and non-arrays", NULL));
255 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
258 else {
259 @@ -2252,7 +2254,7 @@ static int subtract(void)
260 POP_INT(n1);
261 PUSH_INT(n1 - n2);
263 - return(STAT_OK);
264 + return STAT_OK;
268 @@ -2279,7 +2281,7 @@ static int divide(void)
269 POP_INT(n2);
270 POP_INT(n1);
271 if (n2 == 0) {
272 - return execError("division by zero", "");
273 + EXEC_ERROR("division by zero", "");
275 PUSH_INT(n1 / n2);
276 return STAT_OK;
277 @@ -2295,7 +2297,7 @@ static int modulo(void)
278 POP_INT(n2);
279 POP_INT(n1);
280 if (n2 == 0) {
281 - return execError("modulo by zero", "");
282 + EXEC_ERROR("modulo by zero", "");
284 PUSH_INT(n1 % n2);
285 return STAT_OK;
286 @@ -2376,11 +2378,11 @@ static int eq(void)
289 else {
290 - return(execError("incompatible types to compare", NULL));
291 + EXEC_ERROR("incompatible types to compare", NULL);
293 v1.tag = INT_TAG;
294 PUSH(v1);
295 - return(STAT_OK);
296 + return STAT_OK;
299 /* negated eq() call */
300 @@ -2433,13 +2435,13 @@ static int bitAnd(void)
301 rightIter = arrayIterateNext(rightIter);
303 if (!insertResult) {
304 - return(execError("array insertion failure", NULL));
305 + EXEC_ERROR("array insertion failure", NULL);
308 PUSH(resultArray);
310 else {
311 - return(execError("can't mix math with arrays and non-arrays", NULL));
312 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
315 else {
316 @@ -2447,7 +2449,7 @@ static int bitAnd(void)
317 POP_INT(n1);
318 PUSH_INT(n1 & n2);
320 - return(STAT_OK);
321 + return STAT_OK;
325 @@ -2504,13 +2506,13 @@ static int bitOr(void)
326 rightIter = arrayIterateNext(rightIter);
328 if (!insertResult) {
329 - return(execError("array insertion failure", NULL));
330 + EXEC_ERROR("array insertion failure", NULL);
333 PUSH(resultArray);
335 else {
336 - return(execError("can't mix math with arrays and non-arrays", NULL));
337 + EXEC_ERROR("can't mix math with arrays and non-arrays", NULL);
340 else {
341 @@ -2518,7 +2520,7 @@ static int bitOr(void)
342 POP_INT(n1);
343 PUSH_INT(n1 | n2);
345 - return(STAT_OK);
346 + return STAT_OK;
349 static int and(void)
350 @@ -2675,7 +2677,7 @@ static int concat(void)
352 len = concatenateNwithSep(nExpr, "", &out, False);
353 if (len < 0) {
354 - return(execError("can only concatenate with string or integer", NULL));
355 + EXEC_ERROR("can only concatenate with string or integer", NULL);
357 PUSH_STRING(out, len);
358 return STAT_OK;
359 @@ -2732,7 +2734,8 @@ static int callSubroutineFromSymbol(Symb
360 if (symValPtr->tag == SUBR_TAG) {
361 sym = symValPtr->val.sym;
362 } else {
363 - return execError("%s is not a variable holding a subroutine pointer", sym->name);
364 + EXEC_ERROR("%s is not a variable holding a subroutine pointer",
365 + sym->name);
369 @@ -2751,7 +2754,7 @@ static int callSubroutineFromSymbol(Symb
370 PreemptRequest = False;
371 if (!sym->value.val.subr(FocusWindow, StackP,
372 nArgs, &result, &errMsg))
373 - return execError(errMsg, sym->name);
374 + EXEC_ERROR(errMsg, sym->name);
375 PUSH_RET_VAL(result);
376 return PreemptRequest ? STAT_PREEMPT : STAT_OK;
378 @@ -2786,8 +2789,7 @@ static int callSubroutineFromSymbol(Symb
379 Window win;
381 if (haveNamedArgs) {
382 - return execError(
383 - "%s action routine called with named argument array",
384 + EXEC_ERROR("%s action routine called with named argument array",
385 sym->name);
388 @@ -2823,7 +2825,7 @@ static int callSubroutineFromSymbol(Symb
391 /* Calling a non subroutine symbol */
392 - return execError("%s is not a function or subroutine", sym->name);
393 + EXEC_ERROR("%s is not a function or subroutine", sym->name);
397 @@ -2879,7 +2881,7 @@ static int callSubroutineStackedN(void)
399 if (nArgs >= 0) {
400 /* should never happen */
401 - return execError("array argument call to %s erroneous", sym->name);
402 + EXEC_ERROR("array argument call to %s erroneous", sym->name);
405 return callSubroutineFromSymbol(sym, nArgs);
406 @@ -2988,7 +2990,7 @@ static int unpackArrayToArgs(void)
407 POP(argArray);
409 if (argArray.tag != ARRAY_TAG) {
410 - return execError("argument array call made with non-array value", NULL);
411 + EXEC_ERROR("argument array call made with non-array value", NULL);
414 if (haveNamedArgs) {
415 @@ -3023,7 +3025,7 @@ static int unpackArrayToArgs(void)
417 else {
418 if (!ArrayInsert(&dvArray, iter->key, &dvEntry)) {
419 - return(execError("array copy failed", NULL));
420 + EXEC_ERROR("array copy failed", NULL);
424 @@ -3042,7 +3044,7 @@ static int unpackArrayToArgs(void)
426 static int fetchRetVal(void)
428 - return execError("internal error: frv", NULL);
429 + EXEC_ERROR("internal error: frv", NULL);
432 /* see comments for returnValOrNone() */
433 @@ -3182,17 +3184,17 @@ int ArrayCopy(DataValue *dstArray, DataV
434 return(errNum);
436 if (!ArrayInsert(dstArray, srcIter->key, &tmpArray)) {
437 - return(execError("array copy failed", NULL));
438 + return STAT_ERROR;
441 else {
442 if (!ArrayInsert(dstArray, srcIter->key, &srcIter->value)) {
443 - return(execError("array copy failed", NULL));
444 + return STAT_ERROR;
447 srcIter = arrayIterateNext(srcIter);
449 - return(STAT_OK);
450 + return STAT_OK;
454 @@ -3209,9 +3211,9 @@ static int makeArrayKeyFromArgs(int nArg
456 len = concatenateNwithSep(nArgs, ARRAY_DIM_SEP, keyString, leaveParams);
457 if (len < 0) {
458 - return(execError("can only index array with string or int.", NULL));
459 + EXEC_ERROR("can only index array with string or int.", NULL);
461 - return(STAT_OK);
462 + return STAT_OK;
466 @@ -3531,23 +3533,24 @@ static int arrayRef(void)
467 POP(srcArray);
468 if (srcArray.tag == ARRAY_TAG) {
469 if (!ArrayGet(&srcArray, keyString, &valueItem)) {
470 - return(execError("referenced array value not in array: %s", keyString));
471 + EXEC_ERROR("referenced array value not in array: %s",
472 + keyString);
474 PUSH(valueItem);
475 - return(STAT_OK);
476 + return STAT_OK;
478 else {
479 - return(execError("operator [] on non-array", NULL));
480 + EXEC_ERROR("operator [] on non-array", NULL);
483 else {
484 POP(srcArray);
485 if (srcArray.tag == ARRAY_TAG) {
486 PUSH_INT(ArraySize(&srcArray));
487 - return(STAT_OK);
488 + return STAT_OK;
490 else {
491 - return(execError("operator [] on non-array", NULL));
492 + EXEC_ERROR("operator [] on non-array", NULL);
496 @@ -3584,7 +3587,7 @@ static int arrayAssign(void)
497 POP(dstArray);
499 if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) {
500 - return(execError("cannot assign array element of non-array", NULL));
501 + EXEC_ERROR("cannot assign array element of non-array", NULL);
503 if (srcValue.tag == ARRAY_TAG) {
504 DataValue arrayCopyValue;
505 @@ -3596,13 +3599,13 @@ static int arrayAssign(void)
508 if (ArrayInsert(&dstArray, keyString, &srcValue)) {
509 - return(STAT_OK);
510 + return STAT_OK;
512 else {
513 - return(execError("array member allocation failure", NULL));
514 + EXEC_ERROR("array member allocation failure", NULL);
517 - return(execError("empty operator []", NULL));
518 + EXEC_ERROR("empty operator []", NULL);
522 @@ -3640,20 +3643,21 @@ static int arrayRefAndAssignSetup(void)
523 PEEK(srcArray, nDim);
524 if (srcArray.tag == ARRAY_TAG) {
525 if (!ArrayGet(&srcArray, keyString, &valueItem)) {
526 - return(execError("referenced array value not in array: %s", keyString));
527 + EXEC_ERROR("referenced array value not in array: %s",
528 + keyString);
530 PUSH(valueItem);
531 if (binaryOp) {
532 PUSH(moveExpr);
534 - return(STAT_OK);
535 + return STAT_OK;
537 else {
538 - return(execError("operator [] on non-array", NULL));
539 + EXEC_ERROR("operator [] on non-array", NULL);
542 else {
543 - return(execError("array[] not an lvalue", NULL));
544 + EXEC_ERROR("array[] not an lvalue", NULL);
548 @@ -3686,16 +3690,16 @@ static int beginArrayIter(void)
549 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
551 else {
552 - return(execError("bad temporary iterator: %s", iterator->name));
553 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
556 iteratorValPtr->tag = INT_TAG;
557 if (arrayVal.tag != ARRAY_TAG) {
558 - return(execError("can't iterate non-array", NULL));
559 + EXEC_ERROR("can't iterate non-array", NULL);
562 iteratorValPtr->val.arrayPtr = arrayIterateFirst(&arrayVal);
563 - return(STAT_OK);
564 + return STAT_OK;
568 @@ -3752,7 +3756,7 @@ static int arrayIter(void)
569 keyValPtr = &(keySym->value);
571 else {
572 - return(execError("can't assign to: %s", keySym->name));
573 + EXEC_ERROR("can't assign to: %s", keySym->name);
575 keyValPtr->tag = NO_TAG;
577 @@ -3764,7 +3768,7 @@ static int arrayIter(void)
578 valPtr = &(valSym->value);
580 else {
581 - return(execError("can't assign to: %s", valSym->name));
582 + EXEC_ERROR("can't assign to: %s", valSym->name);
584 valPtr->tag = NO_TAG;
586 @@ -3773,7 +3777,7 @@ static int arrayIter(void)
587 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
589 else {
590 - return(execError("bad temporary iterator: %s", iterator->name));
591 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
594 thisEntry = iteratorValPtr->val.arrayPtr;
595 @@ -3794,7 +3798,7 @@ static int arrayIter(void)
596 else {
597 JUMP(branchAddr);
599 - return(STAT_OK);
600 + return STAT_OK;
604 @@ -3822,21 +3826,21 @@ static int beginArrayIterArray(void)
605 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
607 else {
608 - return(execError("bad temporary iterator: %s", iterator->name));
609 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
612 if (nDims < 0) {
613 - return(execError("bad multi dimension", NULL));
614 + EXEC_ERROR("bad multi dimension", NULL);
617 iteratorValPtr->tag = INT_TAG;
618 if (arrayVal.tag != ARRAY_TAG) {
619 - return(execError("can't iterate non-array", NULL));
620 + EXEC_ERROR("can't iterate non-array", NULL);
623 iteratorValPtr->val.arrayPtr = arrayIterateFirst(&arrayVal);
625 - return(STAT_OK);
626 + return STAT_OK;
629 static int countDim(const char *key)
630 @@ -3932,7 +3936,7 @@ static int arrayIterArray(void)
631 keyArrayPtr = &(keyArraySym->value);
633 else {
634 - return(execError("can't assign to: %s", keyArraySym->name));
635 + EXEC_ERROR("can't assign to: %s", keyArraySym->name);
637 keyArrayPtr->tag = ARRAY_TAG;
638 keyArrayPtr->val.arrayPtr = NULL;
639 @@ -3945,7 +3949,7 @@ static int arrayIterArray(void)
640 valPtr = &valSym->value;
642 else {
643 - return(execError("can't assign to: %s", valSym->name));
644 + EXEC_ERROR("can't assign to: %s", valSym->name);
646 valPtr->tag = NO_TAG;
648 @@ -3954,7 +3958,7 @@ static int arrayIterArray(void)
649 iteratorValPtr = &FRAME_GET_SYM_VAL(iterator);
651 else {
652 - return(execError("bad temporary iterator: %s", iterator->name));
653 + EXEC_ERROR("bad temporary iterator: %s", iterator->name);
656 thisEntry = iteratorValPtr->val.arrayPtr;
657 @@ -3975,7 +3979,7 @@ static int arrayIterArray(void)
659 /* set keys */
660 if (!splitKeyIntoArray(thisEntry->key, keyArrayPtr)) {
661 - return(execError("can't split key: %s", thisEntry->key));
662 + EXEC_ERROR("can't split key: %s", thisEntry->key);
665 if (withVal) {
666 @@ -4019,7 +4023,7 @@ static int inArray(void)
668 POP(theArray);
669 if (theArray.tag != ARRAY_TAG) {
670 - return(execError("operator in on non-array", NULL));
671 + EXEC_ERROR("operator in on non-array", NULL);
673 PEEK(leftArray, 0);
674 if (leftArray.tag == ARRAY_TAG) {
675 @@ -4040,7 +4044,7 @@ static int inArray(void)
678 PUSH_INT(inResult);
679 - return(STAT_OK);
680 + return STAT_OK;
684 @@ -4083,15 +4087,15 @@ static int deleteArrayElement(void)
687 else {
688 - return(execError("attempt to delete from non-array", NULL));
689 + EXEC_ERROR("attempt to delete from non-array", NULL);
691 - return(STAT_OK);
692 + return STAT_OK;
695 static int typeOfIn(void)
697 if (inTypeOfMode) {
698 - return(execError("I'm already in typeof-mode", NULL));
699 + EXEC_ERROR("I'm already in typeof-mode", NULL);
702 inTypeOfMode = 1;
703 @@ -4105,7 +4109,7 @@ static int typeOfOut(void)
704 DataValue retVal;
706 if (!inTypeOfMode) {
707 - return(execError("I'm not in typeof-mode", NULL));
708 + EXEC_ERROR("I'm not in typeof-mode", NULL);
711 inTypeOfMode = 0;
712 @@ -4159,7 +4163,7 @@ static int arrayAssignNext(void)
713 POP(dstArray);
715 if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) {
716 - return execError("cannot assign array element of non-array", NULL);
717 + EXEC_ERROR("cannot assign array element of non-array", NULL);
720 if (srcValue.tag == ARRAY_TAG) {
721 @@ -4175,7 +4179,7 @@ static int arrayAssignNext(void)
722 keyString = AllocStringOfNumber(arrayMaxNumIdx(&dstArray) + 1);
724 if (!ArrayInsert(&dstArray, keyString, &srcValue)) {
725 - return execError("array member allocation failure", NULL);
726 + EXEC_ERROR("array member allocation failure", NULL);
729 return STAT_OK;
730 @@ -4199,7 +4203,7 @@ static int arrayNextNumIdx(void)
732 POP(srcArray);
733 if (srcArray.tag != ARRAY_TAG) {
734 - return execError("operator [@] on non-array", NULL);
735 + EXEC_ERROR("operator [@] on non-array", NULL);
738 PUSH_INT(arrayMaxNumIdx(&srcArray) + 1);
739 @@ -4214,9 +4218,9 @@ static int arrayNextNumIdx(void)
740 static int errCheck(const char *s)
742 if (errno == EDOM)
743 - return execError("%s argument out of domain", s);
744 + EXEC_ERROR("%s argument out of domain", s);
745 else if (errno == ERANGE)
746 - return execError("%s result out of range", s);
747 + EXEC_ERROR("%s result out of range", s);
748 else
749 return STAT_OK;