From 664b0e3a265547b63a3eb1e95add6e8b5d0c525d Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Wed, 15 Oct 2008 18:13:52 +0200 Subject: [PATCH] drop abstract-access-to-FrameP.patch it was already reverted in global-RestartData.patch B.W. --- Patch: -abstract-access-to-FrameP.patch Patch: !global-RestartData.patch --- EXEC_ERROR.patch | 134 +++++++++---------- abstract-access-to-FrameP.patch | 201 ----------------------------- global-RestartData.patch | 212 ++----------------------------- handle-error-in-RunMacroAsSubrCall.patch | 2 +- remove-args-from-DISASM_RT.patch | 94 +++++++------- series | 1 - 6 files changed, 127 insertions(+), 517 deletions(-) delete mode 100644 abstract-access-to-FrameP.patch diff --git a/EXEC_ERROR.patch b/EXEC_ERROR.patch index 3dfc447..109dbfc 100644 --- a/EXEC_ERROR.patch +++ b/EXEC_ERROR.patch @@ -38,7 +38,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c instTypeToStr(PC->type)); \ } \ a = PC + PC->val.branch; \ -@@ -1439,7 +1441,7 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1428,7 +1430,7 @@ static void addToGlobalSymTab(Symbol *sy #define POP_CHECK(n) \ do { \ if (!OK_TO_POP(n)) { \ @@ -47,7 +47,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } \ } while (0) -@@ -1450,17 +1452,17 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1439,17 +1441,17 @@ static void addToGlobalSymTab(Symbol *sy #define PUSH_CHECK(n) \ do { \ if (!OK_TO_PUSH(n)) { \ @@ -68,7 +68,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } \ } while (0) -@@ -1489,10 +1491,10 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1478,10 +1480,10 @@ static void addToGlobalSymTab(Symbol *sy __int = dataVal.val.n; \ } else if (dataVal.tag == STRING_TAG) { \ if (!StringToNum(dataVal.val.str.rep, &__int)) {\ @@ -81,7 +81,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c tagToStr(dataVal.tag)); \ } \ number = __int; \ -@@ -1506,7 +1508,7 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1495,7 +1497,7 @@ static void addToGlobalSymTab(Symbol *sy } else if (dataVal.tag == INT_TAG) { \ __str = AllocStringOfNumber(dataVal.val.n); \ } else { \ @@ -90,8 +90,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c tagToStr(dataVal.tag)); \ } \ string = __str; \ -@@ -1604,7 +1606,7 @@ static int pushSymVal(void) - nArgs = FRAME_GET_ARG_COUNT(); +@@ -1593,7 +1595,7 @@ static int pushSymVal(void) + nArgs = FP_GET_ARG_COUNT(FrameP); argNum = s->value.val.n; if (argNum >= nArgs) { - return execError("referenced undefined argument: %s", s->name); @@ -99,7 +99,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (argNum == N_ARGS_ARG_SYM) { symVal.tag = INT_TAG; -@@ -1617,7 +1619,7 @@ static int pushSymVal(void) +@@ -1606,7 +1608,7 @@ static int pushSymVal(void) char *errMsg; if (!(s->value.val.subr)(FocusWindow, NULL, 0, &symVal, &errMsg)) { @@ -108,7 +108,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } else if (s->type == C_FUNCTION_SYM || s->type == MACRO_FUNCTION_SYM -@@ -1625,9 +1627,9 @@ static int pushSymVal(void) +@@ -1614,9 +1616,9 @@ static int pushSymVal(void) symVal.tag = SUBR_TAG; symVal.val.sym = s; } else @@ -120,19 +120,19 @@ diff --quilt old/source/interpret.c new/source/interpret.c } PUSH(symVal); -@@ -1667,8 +1669,8 @@ static int pushArgVal(void) +@@ -1656,8 +1658,8 @@ static int pushArgVal(void) --argNum; - nArgs = FRAME_GET_ARG_COUNT(); + nArgs = FP_GET_ARG_COUNT(FrameP); if (argNum >= nArgs || argNum < 0) { - return execError("referenced undefined argument: $args[%s]", - longAsStr(argNum + 1)); + EXEC_ERROR("referenced undefined argument: $args[%s]", + longAsStr(argNum + 1)); } - PUSH(FRAME_GET_ARG_N(argNum)); + PUSH(FP_GET_ARG_N(FrameP, argNum)); return STAT_OK; -@@ -1707,7 +1709,7 @@ static int pushArgArray(void) - argVal = FRAME_GET_ARG_N(argNum); +@@ -1696,7 +1698,7 @@ static int pushArgArray(void) + argVal = FP_GET_ARG_N(FrameP, argNum); if (!ArrayInsert(argArray, AllocStringOfNumber(argNum + 1), &argVal)) { - return(execError("argument array insertion failure", NULL)); @@ -140,7 +140,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } } -@@ -1743,7 +1745,7 @@ static int pushArraySymVal(void) +@@ -1732,7 +1734,7 @@ static int pushArraySymVal(void) dataPtr = &sym->value; } else { @@ -149,7 +149,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (initEmpty && dataPtr->tag == NO_TAG) { -@@ -1752,7 +1754,7 @@ static int pushArraySymVal(void) +@@ -1741,7 +1743,7 @@ static int pushArraySymVal(void) } if (dataPtr->tag == NO_TAG && !inTypeOfMode) { @@ -158,7 +158,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } PUSH(*dataPtr); -@@ -1845,7 +1847,7 @@ static int anonArrayNextVal(void) +@@ -1834,7 +1836,7 @@ static int anonArrayNextVal(void) sprintf(numString, "%d", nextIndex); if (!ArrayInsert(&anonArray, AllocStringCpy(numString), &exprVal)) { @@ -167,7 +167,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* we need to increment the index for next time */ -@@ -1897,7 +1899,7 @@ static int anonArrayIndexVal(void) +@@ -1886,7 +1888,7 @@ static int anonArrayIndexVal(void) } if (!ArrayInsert(&anonArray, keyString, &exprVal)) { @@ -176,7 +176,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* push the default next index value first, then the array */ -@@ -1988,7 +1990,7 @@ static int namedArg1orN(Boolean isFirst) +@@ -1977,7 +1979,7 @@ static int namedArg1orN(Boolean isFirst) /* if our index is numeric (or can be converted to a number) we must change the next index value */ if (nDim == 1 && StringToNum(keyString, &index)) { @@ -185,7 +185,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (isFirst) { -@@ -2002,7 +2004,7 @@ static int namedArg1orN(Boolean isFirst) +@@ -1991,7 +1993,7 @@ static int namedArg1orN(Boolean isFirst) } if (!ArrayInsert(&argsArray, keyString, &exprVal)) { @@ -194,7 +194,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* and (re)push the array */ -@@ -2050,13 +2052,13 @@ static int assign(void) +@@ -2039,13 +2041,13 @@ static int assign(void) if (sym->type != GLOBAL_SYM && sym->type != LOCAL_SYM) { if (sym->type == ARG_SYM) { @@ -211,7 +211,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } -@@ -2172,13 +2174,13 @@ static int add(void) +@@ -2161,13 +2163,13 @@ static int add(void) rightIter = arrayIterateNext(rightIter); } if (!insertResult) { @@ -227,7 +227,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } else { -@@ -2186,7 +2188,7 @@ static int add(void) +@@ -2175,7 +2177,7 @@ static int add(void) POP_INT(n1); PUSH_INT(n1 + n2); } @@ -236,7 +236,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -2238,13 +2240,13 @@ static int subtract(void) +@@ -2227,13 +2229,13 @@ static int subtract(void) leftIter = arrayIterateNext(leftIter); } if (!insertResult) { @@ -252,7 +252,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } else { -@@ -2252,7 +2254,7 @@ static int subtract(void) +@@ -2241,7 +2243,7 @@ static int subtract(void) POP_INT(n1); PUSH_INT(n1 - n2); } @@ -261,7 +261,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -2279,7 +2281,7 @@ static int divide(void) +@@ -2268,7 +2270,7 @@ static int divide(void) POP_INT(n2); POP_INT(n1); if (n2 == 0) { @@ -270,7 +270,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } PUSH_INT(n1 / n2); return STAT_OK; -@@ -2295,7 +2297,7 @@ static int modulo(void) +@@ -2284,7 +2286,7 @@ static int modulo(void) POP_INT(n2); POP_INT(n1); if (n2 == 0) { @@ -279,7 +279,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } PUSH_INT(n1 % n2); return STAT_OK; -@@ -2376,11 +2378,11 @@ static int eq(void) +@@ -2365,11 +2367,11 @@ static int eq(void) } } else { @@ -293,7 +293,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* negated eq() call */ -@@ -2433,13 +2435,13 @@ static int bitAnd(void) +@@ -2422,13 +2424,13 @@ static int bitAnd(void) rightIter = arrayIterateNext(rightIter); } if (!insertResult) { @@ -309,7 +309,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } else { -@@ -2447,7 +2449,7 @@ static int bitAnd(void) +@@ -2436,7 +2438,7 @@ static int bitAnd(void) POP_INT(n1); PUSH_INT(n1 & n2); } @@ -318,7 +318,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -2504,13 +2506,13 @@ static int bitOr(void) +@@ -2493,13 +2495,13 @@ static int bitOr(void) rightIter = arrayIterateNext(rightIter); } if (!insertResult) { @@ -334,7 +334,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } else { -@@ -2518,7 +2520,7 @@ static int bitOr(void) +@@ -2507,7 +2509,7 @@ static int bitOr(void) POP_INT(n1); PUSH_INT(n1 | n2); } @@ -343,7 +343,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } static int and(void) -@@ -2618,7 +2620,7 @@ static int concatenateNwithSep(int nVals +@@ -2607,7 +2609,7 @@ static int concatenateNwithSep(int nVals len += value.val.str.len; } else { @@ -352,7 +352,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c tagToStr(value.tag)); } } -@@ -2735,7 +2737,8 @@ static int callSubroutineFromSymbol(Symb +@@ -2724,7 +2726,8 @@ static int callSubroutineFromSymbol(Symb if (symValPtr->tag == SUBR_TAG) { sym = symValPtr->val.sym; } else { @@ -362,7 +362,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } -@@ -2754,7 +2757,7 @@ static int callSubroutineFromSymbol(Symb +@@ -2743,7 +2746,7 @@ static int callSubroutineFromSymbol(Symb PreemptRequest = False; if (!sym->value.val.subr(FocusWindow, StackP, nArgs, &result, &errMsg)) @@ -371,7 +371,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c PUSH_RET_VAL(result); return PreemptRequest ? STAT_PREEMPT : STAT_OK; } -@@ -2789,8 +2792,7 @@ static int callSubroutineFromSymbol(Symb +@@ -2778,8 +2781,7 @@ static int callSubroutineFromSymbol(Symb Window win; if (haveNamedArgs) { @@ -381,7 +381,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c sym->name); } -@@ -2826,7 +2828,7 @@ static int callSubroutineFromSymbol(Symb +@@ -2815,7 +2817,7 @@ static int callSubroutineFromSymbol(Symb } /* Calling a non subroutine symbol */ @@ -390,7 +390,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -2896,7 +2898,7 @@ static int callSubroutineUnpackArray(voi +@@ -2885,7 +2887,7 @@ static int callSubroutineUnpackArray(voi POP(argArray); if (argArray.tag != ARRAY_TAG) { @@ -399,7 +399,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (haveNamedArgs) { -@@ -2930,7 +2932,7 @@ static int callSubroutineUnpackArray(voi +@@ -2919,7 +2921,7 @@ static int callSubroutineUnpackArray(voi } else { if (!ArrayInsert(&dvArray, iter->key, &dvEntry)) { @@ -408,7 +408,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } -@@ -3016,7 +3018,7 @@ int OverlayRoutineFromProg(Program *prog +@@ -3005,7 +3007,7 @@ int OverlayRoutineFromProg(Program *prog */ static int fetchRetVal(void) { @@ -417,7 +417,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* see comments for returnValOrNone() */ -@@ -3156,17 +3158,17 @@ int ArrayCopy(DataValue *dstArray, DataV +@@ -3145,17 +3147,17 @@ int ArrayCopy(DataValue *dstArray, DataV return(errNum); } if (!ArrayInsert(dstArray, srcIter->key, &tmpArray)) { @@ -438,7 +438,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -3186,7 +3188,7 @@ static int makeArrayKeyFromArgs(int nArg +@@ -3175,7 +3177,7 @@ static int makeArrayKeyFromArgs(int nArg if (len > 0) { return len; } @@ -447,7 +447,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -3503,23 +3505,24 @@ static int arrayRef(void) +@@ -3492,23 +3494,24 @@ static int arrayRef(void) POP(srcArray); if (srcArray.tag == ARRAY_TAG) { if (!ArrayGet(&srcArray, keyString, &valueItem)) { @@ -477,7 +477,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } } -@@ -3556,7 +3559,7 @@ static int arrayAssign(void) +@@ -3545,7 +3548,7 @@ static int arrayAssign(void) POP(dstArray); if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) { @@ -486,7 +486,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (srcValue.tag == ARRAY_TAG) { DataValue arrayCopyValue; -@@ -3568,13 +3571,13 @@ static int arrayAssign(void) +@@ -3557,13 +3560,13 @@ static int arrayAssign(void) } } if (ArrayInsert(&dstArray, keyString, &srcValue)) { @@ -503,7 +503,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -3612,20 +3615,21 @@ static int arrayRefAndAssignSetup(void) +@@ -3601,20 +3604,21 @@ static int arrayRefAndAssignSetup(void) PEEK(srcArray, nDim); if (srcArray.tag == ARRAY_TAG) { if (!ArrayGet(&srcArray, keyString, &valueItem)) { @@ -529,8 +529,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c } } -@@ -3658,16 +3662,16 @@ static int beginArrayIter(void) - iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); +@@ -3647,16 +3651,16 @@ static int beginArrayIter(void) + iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); } else { - return(execError("bad temporary iterator: %s", iterator->name)); @@ -549,7 +549,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -3724,7 +3728,7 @@ static int arrayIter(void) +@@ -3713,7 +3717,7 @@ static int arrayIter(void) keyValPtr = &(keySym->value); } else { @@ -558,7 +558,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } keyValPtr->tag = NO_TAG; -@@ -3736,7 +3740,7 @@ static int arrayIter(void) +@@ -3725,7 +3729,7 @@ static int arrayIter(void) valPtr = &(valSym->value); } else { @@ -567,8 +567,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c } valPtr->tag = NO_TAG; } -@@ -3745,7 +3749,7 @@ static int arrayIter(void) - iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); +@@ -3734,7 +3738,7 @@ static int arrayIter(void) + iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); } else { - return(execError("bad temporary iterator: %s", iterator->name)); @@ -576,7 +576,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } thisEntry = iteratorValPtr->val.arrayPtr; -@@ -3766,7 +3770,7 @@ static int arrayIter(void) +@@ -3755,7 +3759,7 @@ static int arrayIter(void) else { JUMP(branchAddr); } @@ -585,8 +585,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -3794,21 +3798,21 @@ static int beginArrayIterArray(void) - iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); +@@ -3783,21 +3787,21 @@ static int beginArrayIterArray(void) + iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); } else { - return(execError("bad temporary iterator: %s", iterator->name)); @@ -611,7 +611,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } static int countDim(const char *key) -@@ -3904,7 +3908,7 @@ static int arrayIterArray(void) +@@ -3893,7 +3897,7 @@ static int arrayIterArray(void) keyArrayPtr = &(keyArraySym->value); } else { @@ -620,7 +620,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } keyArrayPtr->tag = ARRAY_TAG; keyArrayPtr->val.arrayPtr = NULL; -@@ -3917,7 +3921,7 @@ static int arrayIterArray(void) +@@ -3906,7 +3910,7 @@ static int arrayIterArray(void) valPtr = &valSym->value; } else { @@ -629,8 +629,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c } valPtr->tag = NO_TAG; } -@@ -3926,7 +3930,7 @@ static int arrayIterArray(void) - iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); +@@ -3915,7 +3919,7 @@ static int arrayIterArray(void) + iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); } else { - return(execError("bad temporary iterator: %s", iterator->name)); @@ -638,7 +638,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } thisEntry = iteratorValPtr->val.arrayPtr; -@@ -3947,7 +3951,7 @@ static int arrayIterArray(void) +@@ -3936,7 +3940,7 @@ static int arrayIterArray(void) /* set keys */ if (!splitKeyIntoArray(thisEntry->key, keyArrayPtr)) { @@ -647,7 +647,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (withVal) { -@@ -3991,7 +3995,7 @@ static int inArray(void) +@@ -3980,7 +3984,7 @@ static int inArray(void) POP(theArray); if (theArray.tag != ARRAY_TAG) { @@ -656,7 +656,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } PEEK(leftArray, 0); if (leftArray.tag == ARRAY_TAG) { -@@ -4012,7 +4016,7 @@ static int inArray(void) +@@ -4001,7 +4005,7 @@ static int inArray(void) } } PUSH_INT(inResult); @@ -665,7 +665,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -4055,15 +4059,15 @@ static int deleteArrayElement(void) +@@ -4044,15 +4048,15 @@ static int deleteArrayElement(void) } } else { @@ -684,7 +684,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } inTypeOfMode = 1; -@@ -4077,7 +4081,7 @@ static int typeOfOut(void) +@@ -4066,7 +4070,7 @@ static int typeOfOut(void) DataValue retVal; if (!inTypeOfMode) { @@ -693,7 +693,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } inTypeOfMode = 0; -@@ -4131,7 +4135,7 @@ static int arrayAssignNext(void) +@@ -4120,7 +4124,7 @@ static int arrayAssignNext(void) POP(dstArray); if (dstArray.tag != ARRAY_TAG && dstArray.tag != NO_TAG) { @@ -702,7 +702,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } if (srcValue.tag == ARRAY_TAG) { -@@ -4147,7 +4151,7 @@ static int arrayAssignNext(void) +@@ -4136,7 +4140,7 @@ static int arrayAssignNext(void) keyString = AllocStringOfNumber(arrayMaxNumIdx(&dstArray) + 1); if (!ArrayInsert(&dstArray, keyString, &srcValue)) { @@ -711,7 +711,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } return STAT_OK; -@@ -4171,7 +4175,7 @@ static int arrayNextNumIdx(void) +@@ -4160,7 +4164,7 @@ static int arrayNextNumIdx(void) POP(srcArray); if (srcArray.tag != ARRAY_TAG) { @@ -720,7 +720,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } PUSH_INT(arrayMaxNumIdx(&srcArray) + 1); -@@ -4186,9 +4190,9 @@ static int arrayNextNumIdx(void) +@@ -4175,9 +4179,9 @@ static int arrayNextNumIdx(void) static int errCheck(const char *s) { if (errno == EDOM) diff --git a/abstract-access-to-FrameP.patch b/abstract-access-to-FrameP.patch deleted file mode 100644 index d1b6f1a..0000000 --- a/abstract-access-to-FrameP.patch +++ /dev/null @@ -1,201 +0,0 @@ ---- - - source/interpret.c | 53 ++++++++++++++++++++++++++++++++--------------------- - 1 file changed, 32 insertions(+), 21 deletions(-) - -diff --quilt old/source/interpret.c new/source/interpret.c ---- old/source/interpret.c -+++ new/source/interpret.c -@@ -1388,6 +1388,17 @@ static void addToGlobalSymTab(Symbol *sy - } \ - } while (0) - -+#define FRAME_GET_ITEM(xIndex) FP_GET_ITEM(FrameP,xIndex) -+#define FRAME_GET_ARG_ARRAY() FP_GET_ARG_ARRAY(FrameP) -+#define FRAME_GET_ARG_COUNT() FP_GET_ARG_COUNT(FrameP) -+#define FRAME_GET_OLD_FP() FP_GET_OLD_FP(FrameP) -+#define FRAME_GET_RET_PC() FP_GET_RET_PC(FrameP) -+#define FRAME_GET_PROG() FP_GET_PROG(FrameP) -+#define FRAME_ARG_START_INDEX() FP_ARG_START_INDEX(FrameP) -+#define FRAME_GET_ARG_N(xN) FP_GET_ARG_N(FrameP,xN) -+#define FRAME_GET_SYM_N(xN) FP_GET_SYM_N(FrameP,xN) -+#define FRAME_GET_SYM_VAL(xSym) FP_GET_SYM_VAL(FrameP,xSym) -+ - /* true, if you can pop n values */ - #define OK_TO_POP(n) \ - ((StackP - (n)) >= TheStack) -@@ -1553,11 +1564,11 @@ static int pushSymVal(void) - GET_SYM(s); - - if (s->type == LOCAL_SYM) { -- symVal = FP_GET_SYM_VAL(FrameP, s); -+ symVal = FRAME_GET_SYM_VAL(s); - } else if (s->type == GLOBAL_SYM || s->type == CONST_SYM) { - symVal = s->value; - } else if (s->type == ARG_SYM) { -- nArgs = FP_GET_ARG_COUNT(FrameP); -+ nArgs = FRAME_GET_ARG_COUNT(); - argNum = s->value.val.n; - if (argNum >= nArgs) { - return execError("referenced undefined argument: %s", s->name); -@@ -1567,7 +1578,7 @@ static int pushSymVal(void) - symVal.val.n = nArgs; - } - else { -- symVal = FP_GET_ARG_N(FrameP, argNum); -+ symVal = FRAME_GET_ARG_N(argNum); - } - } else if (s->type == PROC_VALUE_SYM) { - char *errMsg; -@@ -1621,12 +1632,12 @@ static int pushArgVal(void) - - POP_INT(argNum); - --argNum; -- nArgs = FP_GET_ARG_COUNT(FrameP); -+ nArgs = FRAME_GET_ARG_COUNT(); - if (argNum >= nArgs || argNum < 0) { - return execError("referenced undefined argument: $args[%s]", - longAsStr(argNum + 1)); - } -- PUSH(FP_GET_ARG_N(FrameP, argNum)); -+ PUSH(FRAME_GET_ARG_N(argNum)); - return STAT_OK; - } - -@@ -1635,7 +1646,7 @@ static int pushArgCount(void) - DISASM_RT(PC-1, 1); - STACKDUMP(0, 3); - -- PUSH_INT(FP_GET_ARG_COUNT(FrameP)); -+ PUSH_INT(FRAME_GET_ARG_COUNT()); - return STAT_OK; - } - -@@ -1648,8 +1659,8 @@ static int pushArgArray(void) - DISASM_RT(PC-1, 1); - STACKDUMP(0, 3); - -- nArgs = FP_GET_ARG_COUNT(FrameP); -- argArray = &FP_GET_ARG_ARRAY(FrameP); -+ nArgs = FRAME_GET_ARG_COUNT(); -+ argArray = &FRAME_GET_ARG_ARRAY(); - if (argArray->tag != ARRAY_TAG) { - /* we require a real array in the argArray position */ - argArray->tag = ARRAY_TAG; -@@ -1660,7 +1671,7 @@ static int pushArgArray(void) - if (needArgCopy || (nArgs && !ArrayGet(argArray, (char *)"1", &argVal))) { - /* load arguments from positional arg list if not already done */ - for (argNum = 0; argNum < nArgs; ++argNum) { -- argVal = FP_GET_ARG_N(FrameP, argNum); -+ argVal = FRAME_GET_ARG_N(argNum); - if (!ArrayInsert(argArray, AllocStringOfNumber(argNum + 1), - &argVal)) { - return(execError("argument array insertion failure", NULL)); -@@ -1693,7 +1704,7 @@ static int pushArraySymVal(void) - GET_IMMED(initEmpty); - - if (sym->type == LOCAL_SYM) { -- dataPtr = &FP_GET_SYM_VAL(FrameP, sym); -+ dataPtr = &FRAME_GET_SYM_VAL(sym); - } - else if (sym->type == GLOBAL_SYM) { - dataPtr = &sym->value; -@@ -2015,7 +2026,7 @@ static int assign(void) - } - - if (sym->type == LOCAL_SYM) { -- dataPtr = &FP_GET_SYM_VAL(FrameP, sym); -+ dataPtr = &FRAME_GET_SYM_VAL(sym); - } - else { - dataPtr = &sym->value; -@@ -2680,7 +2691,7 @@ static int callSubroutineFromSymbol(Symb - } - - if (sym->type == LOCAL_SYM) { -- symValPtr = &FP_GET_SYM_VAL(FrameP, sym); -+ symValPtr = &FRAME_GET_SYM_VAL(sym); - } else if (sym->type == GLOBAL_SYM) { - symValPtr = &sym->value; - } -@@ -2991,7 +3002,7 @@ static int returnValOrNone(int valOnStac - static DataValue noValue = {NO_TAG, {0}}; - - DISASM_RT(PC-1, 1); -- STACKDUMP(StackP - FrameP + FP_GET_ARG_COUNT(FrameP) + FP_TO_ARGS_DIST, 3); -+ STACKDUMP(StackP - FrameP + FRAME_GET_ARG_COUNT() + FP_TO_ARGS_DIST, 3); - - /* return value is on the stack */ - if (valOnStack) { -@@ -3601,7 +3612,7 @@ static int beginArrayIter(void) - POP(arrayVal); - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); -+ iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); - } - else { - return(execError("bad temporary iterator: %s", iterator->name)); -@@ -3664,7 +3675,7 @@ static int arrayIter(void) - GET_BRANCH(branchAddr); - - if (keySym->type == LOCAL_SYM) { -- keyValPtr = &FP_GET_SYM_VAL(FrameP, keySym); -+ keyValPtr = &FRAME_GET_SYM_VAL(keySym); - } - else if (keySym->type == GLOBAL_SYM) { - keyValPtr = &(keySym->value); -@@ -3676,7 +3687,7 @@ static int arrayIter(void) - - if (withVal) { - if (valSym->type == LOCAL_SYM) { -- valPtr = &FP_GET_SYM_VAL(FrameP, valSym); -+ valPtr = &FRAME_GET_SYM_VAL(valSym); - } - else if (valSym->type == GLOBAL_SYM) { - valPtr = &(valSym->value); -@@ -3688,7 +3699,7 @@ static int arrayIter(void) - } - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); -+ iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); - } - else { - return(execError("bad temporary iterator: %s", iterator->name)); -@@ -3737,7 +3748,7 @@ static int beginArrayIterArray(void) - PEEK_INT(nDims, 0); - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); -+ iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); - } - else { - return(execError("bad temporary iterator: %s", iterator->name)); -@@ -3844,7 +3855,7 @@ static int arrayIterArray(void) - PEEK_INT(nDims, 0); - - if (keyArraySym->type == LOCAL_SYM) { -- keyArrayPtr = &FP_GET_SYM_VAL(FrameP, keyArraySym); -+ keyArrayPtr = &FRAME_GET_SYM_VAL(keyArraySym); - } - else if (keyArraySym->type == GLOBAL_SYM) { - keyArrayPtr = &(keyArraySym->value); -@@ -3857,7 +3868,7 @@ static int arrayIterArray(void) - - if (withVal) { - if (valSym->type == LOCAL_SYM) { -- valPtr = &FP_GET_SYM_VAL(FrameP, valSym); -+ valPtr = &FRAME_GET_SYM_VAL(valSym); - } - else if (valSym->type == GLOBAL_SYM) { - valPtr = &valSym->value; -@@ -3869,7 +3880,7 @@ static int arrayIterArray(void) - } - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); -+ iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); - } - else { - return(execError("bad temporary iterator: %s", iterator->name)); diff --git a/global-RestartData.patch b/global-RestartData.patch index 952d28b..904f5e0 100644 --- a/global-RestartData.patch +++ b/global-RestartData.patch @@ -1,8 +1,8 @@ --- - source/interpret.c | 186 +++++++++++++++++++++-------------------------------- - source/interpret.h | 3 - 2 files changed, 78 insertions(+), 111 deletions(-) + source/interpret.c | 133 +++++++++++++++++++++-------------------------------- + source/interpret.h | 3 - + 2 files changed, 57 insertions(+), 79 deletions(-) diff --quilt old/source/interpret.c new/source/interpret.c --- old/source/interpret.c @@ -241,25 +241,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } static void freeSymbolList(Symbol *symList) -@@ -1423,17 +1406,6 @@ static void addToGlobalSymTab(Symbol *sy - } \ - } while (0) - --#define FRAME_GET_ITEM(xIndex) FP_GET_ITEM(FrameP,xIndex) --#define FRAME_GET_ARG_ARRAY() FP_GET_ARG_ARRAY(FrameP) --#define FRAME_GET_ARG_COUNT() FP_GET_ARG_COUNT(FrameP) --#define FRAME_GET_OLD_FP() FP_GET_OLD_FP(FrameP) --#define FRAME_GET_RET_PC() FP_GET_RET_PC(FrameP) --#define FRAME_GET_PROG() FP_GET_PROG(FrameP) --#define FRAME_ARG_START_INDEX() FP_ARG_START_INDEX(FrameP) --#define FRAME_GET_ARG_N(xN) FP_GET_ARG_N(FrameP,xN) --#define FRAME_GET_SYM_N(xN) FP_GET_SYM_N(FrameP,xN) --#define FRAME_GET_SYM_VAL(xSym) FP_GET_SYM_VAL(FrameP,xSym) -- - /* true, if you can pop n values */ - #define OK_TO_POP(n) \ - ((StackP - (n)) >= TheStack) -@@ -1447,7 +1419,7 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1436,7 +1419,7 @@ static void addToGlobalSymTab(Symbol *sy /* true, if you can push n values */ #define OK_TO_PUSH(n) \ @@ -268,26 +250,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c #define PUSH_CHECK(n) \ do { \ -@@ -1599,11 +1571,11 @@ static int pushSymVal(void) - GET_SYM(s); - - if (s->type == LOCAL_SYM) { -- symVal = FRAME_GET_SYM_VAL(s); -+ symVal = FP_GET_SYM_VAL(FrameP, s); - } else if (s->type == GLOBAL_SYM || s->type == CONST_SYM) { - symVal = s->value; - } else if (s->type == ARG_SYM) { -- nArgs = FRAME_GET_ARG_COUNT(); -+ nArgs = FP_GET_ARG_COUNT(FrameP); - argNum = s->value.val.n; - if (argNum >= nArgs) { - EXEC_ERROR("referenced undefined argument: %s", s->name); -@@ -1613,12 +1585,11 @@ static int pushSymVal(void) - symVal.val.n = nArgs; - } - else { -- symVal = FRAME_GET_ARG_N(argNum); -+ symVal = FP_GET_ARG_N(FrameP, argNum); +@@ -1605,9 +1588,8 @@ static int pushSymVal(void) + symVal = FP_GET_ARG_N(FrameP, argNum); } } else if (s->type == PROC_VALUE_SYM) { - char *errMsg; @@ -298,69 +262,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c EXEC_ERROR(errMsg, s->name); } } else if (s->type == C_FUNCTION_SYM -@@ -1667,12 +1638,12 @@ static int pushArgVal(void) - - POP_INT(argNum); - --argNum; -- nArgs = FRAME_GET_ARG_COUNT(); -+ nArgs = FP_GET_ARG_COUNT(FrameP); - if (argNum >= nArgs || argNum < 0) { - EXEC_ERROR("referenced undefined argument: $args[%s]", - longAsStr(argNum + 1)); - } -- PUSH(FRAME_GET_ARG_N(argNum)); -+ PUSH(FP_GET_ARG_N(FrameP, argNum)); - return STAT_OK; - } - -@@ -1681,7 +1652,7 @@ static int pushArgCount(void) - DISASM_RT(); - STACKDUMP(0, 3); - -- PUSH_INT(FRAME_GET_ARG_COUNT()); -+ PUSH_INT(FP_GET_ARG_COUNT(FrameP)); - return STAT_OK; - } - -@@ -1694,8 +1665,8 @@ static int pushArgArray(void) - DISASM_RT(); - STACKDUMP(0, 3); - -- nArgs = FRAME_GET_ARG_COUNT(); -- argArray = &FRAME_GET_ARG_ARRAY(); -+ nArgs = FP_GET_ARG_COUNT(FrameP); -+ argArray = &FP_GET_ARG_ARRAY(FrameP); - if (argArray->tag != ARRAY_TAG) { - /* we require a real array in the argArray position */ - argArray->tag = ARRAY_TAG; -@@ -1706,7 +1677,7 @@ static int pushArgArray(void) - if (needArgCopy || (nArgs && !ArrayGet(argArray, (char *)"1", &argVal))) { - /* load arguments from positional arg list if not already done */ - for (argNum = 0; argNum < nArgs; ++argNum) { -- argVal = FRAME_GET_ARG_N(argNum); -+ argVal = FP_GET_ARG_N(FrameP, argNum); - if (!ArrayInsert(argArray, AllocStringOfNumber(argNum + 1), - &argVal)) { - EXEC_ERROR("argument array insertion failure", NULL); -@@ -1739,7 +1710,7 @@ static int pushArraySymVal(void) - GET_IMMED(initEmpty); - - if (sym->type == LOCAL_SYM) { -- dataPtr = &FRAME_GET_SYM_VAL(sym); -+ dataPtr = &FP_GET_SYM_VAL(FrameP, sym); - } - else if (sym->type == GLOBAL_SYM) { - dataPtr = &sym->value; -@@ -2063,7 +2034,7 @@ static int assign(void) - } - - if (sym->type == LOCAL_SYM) { -- dataPtr = &FRAME_GET_SYM_VAL(sym); -+ dataPtr = &FP_GET_SYM_VAL(FrameP, sym); - } - else { - dataPtr = &sym->value; -@@ -2388,8 +2359,8 @@ static int eq(void) +@@ -2377,8 +2359,8 @@ static int eq(void) /* negated eq() call */ static int ne(void) { @@ -371,7 +273,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -2719,7 +2690,6 @@ static int callSubroutineFromSymbol(Symb +@@ -2708,7 +2690,6 @@ static int callSubroutineFromSymbol(Symb static DataValue noValue = {NO_TAG, {0}}; DataValue argArray = noValue; Program *prog; @@ -379,16 +281,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c int haveNamedArgs = (nArgs < 0); DataValue *symValPtr = NULL; -@@ -2729,7 +2699,7 @@ static int callSubroutineFromSymbol(Symb - } - - if (sym->type == LOCAL_SYM) { -- symValPtr = &FRAME_GET_SYM_VAL(sym); -+ symValPtr = &FP_GET_SYM_VAL(FrameP, sym); - } else if (sym->type == GLOBAL_SYM) { - symValPtr = &sym->value; - } -@@ -2747,6 +2717,7 @@ static int callSubroutineFromSymbol(Symb +@@ -2736,6 +2717,7 @@ static int callSubroutineFromSymbol(Symb */ if (sym->type == C_FUNCTION_SYM) { DataValue result; @@ -396,7 +289,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c PUSH(argArray); /* push dummy named arg array */ -@@ -2755,9 +2726,9 @@ static int callSubroutineFromSymbol(Symb +@@ -2744,9 +2726,9 @@ static int callSubroutineFromSymbol(Symb /* Call the function and check for preemption */ PreemptRequest = False; @@ -408,7 +301,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c PUSH_RET_VAL(result); return PreemptRequest ? STAT_PREEMPT : STAT_OK; } -@@ -2770,15 +2741,10 @@ static int callSubroutineFromSymbol(Symb +@@ -2759,15 +2741,10 @@ static int callSubroutineFromSymbol(Symb ** values which are already there. */ if (sym->type == MACRO_FUNCTION_SYM) { @@ -425,16 +318,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c } /* -@@ -3044,7 +3010,7 @@ static int returnValOrNone(int valOnStac - static DataValue noValue = {NO_TAG, {0}}; - - DISASM_RT(); -- STACKDUMP(StackP - FrameP + FRAME_GET_ARG_COUNT() + FP_TO_ARGS_DIST, 3); -+ STACKDUMP(StackP - FrameP + FP_GET_ARG_COUNT(FrameP) + FP_TO_ARGS_DIST, 3); - - /* return value is on the stack */ - if (valOnStack) { -@@ -3054,7 +3020,7 @@ static int returnValOrNone(int valOnStac +@@ -3043,7 +3020,7 @@ static int returnValOrNone(int valOnStac retVal = noValue; } @@ -443,78 +327,6 @@ diff --quilt old/source/interpret.c new/source/interpret.c /* push returned value, if requsted */ PUSH_RET_VAL(retVal); -@@ -3659,7 +3625,7 @@ static int beginArrayIter(void) - POP(arrayVal); - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); -+ iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); - } - else { - EXEC_ERROR("bad temporary iterator: %s", iterator->name); -@@ -3722,7 +3688,7 @@ static int arrayIter(void) - GET_BRANCH(branchAddr); - - if (keySym->type == LOCAL_SYM) { -- keyValPtr = &FRAME_GET_SYM_VAL(keySym); -+ keyValPtr = &FP_GET_SYM_VAL(FrameP, keySym); - } - else if (keySym->type == GLOBAL_SYM) { - keyValPtr = &(keySym->value); -@@ -3734,7 +3700,7 @@ static int arrayIter(void) - - if (withVal) { - if (valSym->type == LOCAL_SYM) { -- valPtr = &FRAME_GET_SYM_VAL(valSym); -+ valPtr = &FP_GET_SYM_VAL(FrameP, valSym); - } - else if (valSym->type == GLOBAL_SYM) { - valPtr = &(valSym->value); -@@ -3746,7 +3712,7 @@ static int arrayIter(void) - } - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); -+ iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); - } - else { - EXEC_ERROR("bad temporary iterator: %s", iterator->name); -@@ -3795,7 +3761,7 @@ static int beginArrayIterArray(void) - PEEK_INT(nDims, 0); - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); -+ iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); - } - else { - EXEC_ERROR("bad temporary iterator: %s", iterator->name); -@@ -3902,7 +3868,7 @@ static int arrayIterArray(void) - PEEK_INT(nDims, 0); - - if (keyArraySym->type == LOCAL_SYM) { -- keyArrayPtr = &FRAME_GET_SYM_VAL(keyArraySym); -+ keyArrayPtr = &FP_GET_SYM_VAL(FrameP, keyArraySym); - } - else if (keyArraySym->type == GLOBAL_SYM) { - keyArrayPtr = &(keyArraySym->value); -@@ -3915,7 +3881,7 @@ static int arrayIterArray(void) - - if (withVal) { - if (valSym->type == LOCAL_SYM) { -- valPtr = &FRAME_GET_SYM_VAL(valSym); -+ valPtr = &FP_GET_SYM_VAL(FrameP, valSym); - } - else if (valSym->type == GLOBAL_SYM) { - valPtr = &valSym->value; -@@ -3927,7 +3893,7 @@ static int arrayIterArray(void) - } - - if (iterator->type == LOCAL_SYM) { -- iteratorValPtr = &FRAME_GET_SYM_VAL(iterator); -+ iteratorValPtr = &FP_GET_SYM_VAL(FrameP, iterator); - } - else { - EXEC_ERROR("bad temporary iterator: %s", iterator->name); diff --quilt old/source/interpret.h new/source/interpret.h --- old/source/interpret.h +++ new/source/interpret.h diff --git a/handle-error-in-RunMacroAsSubrCall.patch b/handle-error-in-RunMacroAsSubrCall.patch index b9b65f3..561e4e4 100644 --- a/handle-error-in-RunMacroAsSubrCall.patch +++ b/handle-error-in-RunMacroAsSubrCall.patch @@ -219,7 +219,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c XtFree((char *)context->stack); XtFree((char *)context); } -@@ -2731,12 +2764,15 @@ static int callSubroutineFromSymbol(Symb +@@ -2720,12 +2753,15 @@ static int callSubroutineFromSymbol(Symb ** values which are already there. */ if (sym->type == MACRO_FUNCTION_SYM) { diff --git a/remove-args-from-DISASM_RT.patch b/remove-args-from-DISASM_RT.patch index 12e9442..86e5655 100644 --- a/remove-args-from-DISASM_RT.patch +++ b/remove-args-from-DISASM_RT.patch @@ -19,7 +19,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c #endif /* #ifndef DEBUG_STACK */ /* Global symbols and function definitions, is null initialized */ -@@ -1560,7 +1560,7 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1549,7 +1549,7 @@ static void addToGlobalSymTab(Symbol *sy #define BINARY_NUMERIC_OPERATION(operator) \ do { \ int n1, n2; \ @@ -28,7 +28,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); \ POP_INT(n2); \ POP_INT(n1); \ -@@ -1571,7 +1571,7 @@ static void addToGlobalSymTab(Symbol *sy +@@ -1560,7 +1560,7 @@ static void addToGlobalSymTab(Symbol *sy #define UNARY_NUMERIC_OPERATION(operator) \ do { \ int n; \ @@ -37,7 +37,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 3); \ POP_INT(n); \ PUSH_INT(operator n); \ -@@ -1591,7 +1591,7 @@ static int pushSymVal(void) +@@ -1580,7 +1580,7 @@ static int pushSymVal(void) int nArgs, argNum; DataValue symVal; @@ -46,7 +46,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 3); GET_SYM(s); -@@ -1646,7 +1646,7 @@ static int pushImmed(void) +@@ -1635,7 +1635,7 @@ static int pushImmed(void) { int immed; @@ -55,7 +55,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 3); GET_IMMED(immed); -@@ -1660,7 +1660,7 @@ static int pushArgVal(void) +@@ -1649,7 +1649,7 @@ static int pushArgVal(void) { int nArgs, argNum; @@ -64,7 +64,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 3); POP_INT(argNum); -@@ -1676,7 +1676,7 @@ static int pushArgVal(void) +@@ -1665,7 +1665,7 @@ static int pushArgVal(void) static int pushArgCount(void) { @@ -72,8 +72,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c + DISASM_RT(); STACKDUMP(0, 3); - PUSH_INT(FRAME_GET_ARG_COUNT()); -@@ -1689,7 +1689,7 @@ static int pushArgArray(void) + PUSH_INT(FP_GET_ARG_COUNT(FrameP)); +@@ -1678,7 +1678,7 @@ static int pushArgArray(void) DataValue argVal, *argArray; Boolean needArgCopy = False; @@ -81,8 +81,8 @@ diff --quilt old/source/interpret.c new/source/interpret.c + DISASM_RT(); STACKDUMP(0, 3); - nArgs = FRAME_GET_ARG_COUNT(); -@@ -1730,7 +1730,7 @@ static int pushArraySymVal(void) + nArgs = FP_GET_ARG_COUNT(FrameP); +@@ -1719,7 +1719,7 @@ static int pushArraySymVal(void) DataValue *dataPtr; int initEmpty; @@ -91,7 +91,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 3); GET_SYM(sym); -@@ -1773,7 +1773,7 @@ static int anonArrayOpen(void) +@@ -1762,7 +1762,7 @@ static int anonArrayOpen(void) { DataValue dataVal; @@ -100,7 +100,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 3); /* make an empty array */ -@@ -1804,7 +1804,7 @@ static int anonArraySkip(void) +@@ -1793,7 +1793,7 @@ static int anonArraySkip(void) DataValue anonArray; int nextIndex; @@ -109,7 +109,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP(anonArray); -@@ -1836,7 +1836,7 @@ static int anonArrayNextVal(void) +@@ -1825,7 +1825,7 @@ static int anonArrayNextVal(void) int nextIndex; char numString[TYPE_INT_STR_SIZE(int)]; @@ -118,7 +118,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(3, 3); POP(exprVal); -@@ -1873,9 +1873,10 @@ static int anonArrayIndexVal(void) +@@ -1862,9 +1862,10 @@ static int anonArrayIndexVal(void) int nextIndex, index; int nDim; @@ -130,7 +130,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nDim+3, 3); POP(exprVal); -@@ -1920,7 +1921,7 @@ static int anonArrayClose(void) +@@ -1909,7 +1910,7 @@ static int anonArrayClose(void) DataValue anonArray; DataValue next_index; @@ -139,7 +139,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); /* remove top two elements */ -@@ -1970,9 +1971,10 @@ static int namedArg1orN(Boolean isFirst) +@@ -1959,9 +1960,10 @@ static int namedArg1orN(Boolean isFirst) DataValue exprVal, argsArray; int nDim, index; @@ -151,7 +151,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nDim + (isFirst ? 2 : 1), 3); POP(exprVal); -@@ -2016,7 +2018,7 @@ static int swapTop2(void) +@@ -2005,7 +2007,7 @@ static int swapTop2(void) { DataValue dv1, dv2; @@ -160,7 +160,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP(dv1); -@@ -2041,7 +2043,7 @@ static int assign(void) +@@ -2030,7 +2032,7 @@ static int assign(void) DataValue *dataPtr; DataValue value; @@ -169,7 +169,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 3); GET_SYM(sym); -@@ -2088,7 +2090,7 @@ static int popStack(void) +@@ -2077,7 +2079,7 @@ static int popStack(void) { DataValue val; @@ -178,7 +178,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 4); POP(val); -@@ -2105,7 +2107,7 @@ static int dupStack(void) +@@ -2094,7 +2096,7 @@ static int dupStack(void) { DataValue value; @@ -187,7 +187,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 3); PEEK(value, 0); -@@ -2127,7 +2129,7 @@ static int add(void) +@@ -2116,7 +2118,7 @@ static int add(void) DataValue leftVal, rightVal, resultArray; int n1, n2; @@ -196,7 +196,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); PEEK(rightVal, 0); -@@ -2199,7 +2201,7 @@ static int subtract(void) +@@ -2188,7 +2190,7 @@ static int subtract(void) DataValue leftVal, rightVal, resultArray; int n1, n2; @@ -205,7 +205,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); PEEK(rightVal, 0); -@@ -2271,7 +2273,7 @@ static int divide(void) +@@ -2260,7 +2262,7 @@ static int divide(void) { int n1, n2; @@ -214,7 +214,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP_INT(n2); -@@ -2287,7 +2289,7 @@ static int modulo(void) +@@ -2276,7 +2278,7 @@ static int modulo(void) { int n1, n2; @@ -223,7 +223,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP_INT(n2); -@@ -2344,7 +2346,7 @@ static int eq(void) +@@ -2333,7 +2335,7 @@ static int eq(void) { DataValue v1, v2; @@ -232,7 +232,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP(v1); -@@ -2400,7 +2402,7 @@ static int bitAnd(void) +@@ -2389,7 +2391,7 @@ static int bitAnd(void) DataValue leftVal, rightVal, resultArray; int n1, n2; @@ -241,7 +241,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); PEEK(rightVal, 0); -@@ -2460,7 +2462,7 @@ static int bitOr(void) +@@ -2449,7 +2451,7 @@ static int bitOr(void) DataValue leftVal, rightVal, resultArray; int n1, n2; @@ -250,7 +250,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); PEEK(rightVal, 0); -@@ -2543,7 +2545,7 @@ static int power(void) +@@ -2532,7 +2534,7 @@ static int power(void) { int n1, n2, n3; @@ -259,7 +259,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP_INT(n2); -@@ -2667,9 +2669,10 @@ static int concat(void) +@@ -2656,9 +2658,10 @@ static int concat(void) int nExpr; @@ -271,7 +271,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nExpr, 3); /* remember: concatenateNwithSep() succeeds with a non-positive number */ -@@ -2840,10 +2843,11 @@ static int callSubroutine(void) +@@ -2829,10 +2832,11 @@ static int callSubroutine(void) Symbol *sym; int nArgs; @@ -284,7 +284,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nArgs > 0 ? nArgs : -nArgs, 3); return callSubroutineFromSymbol(sym, nArgs); -@@ -2877,7 +2881,7 @@ static int callSubroutineUnpackArray(voi +@@ -2866,7 +2870,7 @@ static int callSubroutineUnpackArray(voi SparseArrayEntry *iter; DataValue dvEntry, dvArray, argArray; @@ -293,16 +293,16 @@ diff --quilt old/source/interpret.c new/source/interpret.c GET_SYM(sym); GET_IMMED(nArgs); -@@ -3037,7 +3041,7 @@ static int returnValOrNone(int valOnStac +@@ -3026,7 +3030,7 @@ static int returnValOrNone(int valOnStac DataValue retVal; static DataValue noValue = {NO_TAG, {0}}; - DISASM_RT(PC-1, 1); + DISASM_RT(); - STACKDUMP(StackP - FrameP + FRAME_GET_ARG_COUNT() + FP_TO_ARGS_DIST, 3); + STACKDUMP(StackP - FrameP + FP_GET_ARG_COUNT(FrameP) + FP_TO_ARGS_DIST, 3); /* return value is on the stack */ -@@ -3067,7 +3071,7 @@ static int branch(void) +@@ -3056,7 +3060,7 @@ static int branch(void) { Inst *addr; @@ -311,7 +311,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 3); GET_BRANCH(addr); -@@ -3097,7 +3101,7 @@ static int branchIf(Boolean trueOrFalse) +@@ -3086,7 +3090,7 @@ static int branchIf(Boolean trueOrFalse) int value; Inst *addr; @@ -320,7 +320,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 3); GET_BRANCH(addr); -@@ -3121,7 +3125,7 @@ static int branchNever(void) +@@ -3110,7 +3114,7 @@ static int branchNever(void) { Inst *addr; @@ -329,7 +329,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 3); GET_BRANCH(addr); -@@ -3484,9 +3488,10 @@ static int arrayRef(void) +@@ -3473,9 +3477,10 @@ static int arrayRef(void) char *keyString = NULL; int nDim; @@ -341,7 +341,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nDim+1, 3); if (nDim > 0) { -@@ -3534,9 +3539,10 @@ static int arrayAssign(void) +@@ -3523,9 +3528,10 @@ static int arrayAssign(void) int errNum; int nDim; @@ -353,7 +353,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nDim+2, 3); if (nDim > 0) { -@@ -3586,10 +3592,11 @@ static int arrayRefAndAssignSetup(void) +@@ -3575,10 +3581,11 @@ static int arrayRefAndAssignSetup(void) char *keyString = NULL; int binaryOp, nDim; @@ -366,7 +366,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nDim + (binaryOp ? 2 : 1), 3); if (binaryOp) { -@@ -3640,7 +3647,7 @@ static int beginArrayIter(void) +@@ -3629,7 +3636,7 @@ static int beginArrayIter(void) DataValue *iteratorValPtr; DataValue arrayVal; @@ -375,7 +375,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 3); GET_SYM(iterator); -@@ -3699,7 +3706,7 @@ static int arrayIter(void) +@@ -3688,7 +3695,7 @@ static int arrayIter(void) Inst *branchAddr; int withVal; @@ -384,7 +384,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(0, 4); GET_IMMED(withVal); -@@ -3775,7 +3782,7 @@ static int beginArrayIterArray(void) +@@ -3764,7 +3771,7 @@ static int beginArrayIterArray(void) DataValue arrayVal; int nDims; @@ -393,7 +393,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); GET_SYM(iterator); -@@ -3877,7 +3884,7 @@ static int arrayIterArray(void) +@@ -3866,7 +3873,7 @@ static int arrayIterArray(void) int nDims, d; Boolean keyFound = False; @@ -402,7 +402,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(1, 4); GET_IMMED(withVal); -@@ -3979,7 +3986,7 @@ static int inArray(void) +@@ -3968,7 +3975,7 @@ static int inArray(void) char *keyStr; int inResult = 0; @@ -411,7 +411,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP(theArray); -@@ -4023,9 +4030,10 @@ static int deleteArrayElement(void) +@@ -4012,9 +4019,10 @@ static int deleteArrayElement(void) char *keyString = NULL; int nDim; @@ -423,7 +423,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(nDim + 1, 3); if (nDim > 0) { -@@ -4116,7 +4124,7 @@ static int arrayAssignNext(void) +@@ -4105,7 +4113,7 @@ static int arrayAssignNext(void) DataValue srcValue, dstArray; int errNum; @@ -432,7 +432,7 @@ diff --quilt old/source/interpret.c new/source/interpret.c STACKDUMP(2, 3); POP(srcValue); -@@ -4158,7 +4166,7 @@ static int arrayNextNumIdx(void) +@@ -4147,7 +4155,7 @@ static int arrayNextNumIdx(void) DataValue srcArray; SparseArrayEntry *iter; diff --git a/series b/series index 022b053..025986d 100644 --- a/series +++ b/series @@ -116,7 +116,6 @@ op-not-func-in-Inst.patch unify-branch-setup.patch abstract-access-to-PC.patch typed-Inst.patch -abstract-access-to-FrameP.patch handle-error-in-RunMacroAsSubrCall.patch remove-args-from-DISASM_RT.patch EXEC_ERROR.patch -- 2.11.4.GIT