Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/tcl/tclVar.c

    radeddd8 rd7d2da3  
    711711    char *msg;
    712712
     713#ifdef TCL_COMPILE_DEBUG
     714    Proc *procPtr = varFramePtr->procPtr;
     715    int localCt = procPtr->numCompiledLocals;
     716
     717    if (compiledLocals == NULL) {
     718        fprintf(stderr, "\nTclGetIndexedScalar: can't get local %i in frame 0x%x, no compiled locals\n",
     719                localIndex, (unsigned int) varFramePtr);
     720        panic("TclGetIndexedScalar: no compiled locals in frame 0x%x",
     721                (unsigned int) varFramePtr);
     722    }
     723    if ((localIndex < 0) || (localIndex >= localCt)) {
     724        fprintf(stderr, "\nTclGetIndexedScalar: can't get local %i in frame 0x%x with %i locals\n",
     725                localIndex, (unsigned int) varFramePtr, localCt);
     726        panic("TclGetIndexedScalar: bad local index %i in frame 0x%x",
     727                localIndex, (unsigned int) varFramePtr);
     728    }
     729#endif /* TCL_COMPILE_DEBUG */
     730   
    713731    varPtr = &(compiledLocals[localIndex]);
    714732    varName = varPtr->name;
     
    814832    int new;
    815833
     834#ifdef TCL_COMPILE_DEBUG
     835    Proc *procPtr = varFramePtr->procPtr;
     836    int localCt = procPtr->numCompiledLocals;
     837
     838    if (compiledLocals == NULL) {
     839        fprintf(stderr, "\nTclGetElementOfIndexedArray: can't get element of local %i in frame 0x%x, no compiled locals\n",
     840                localIndex, (unsigned int) varFramePtr);
     841        panic("TclGetIndexedScalar: no compiled locals in frame 0x%x",
     842                (unsigned int) varFramePtr);
     843    }
     844    if ((localIndex < 0) || (localIndex >= localCt)) {
     845        fprintf(stderr, "\nTclGetIndexedScalar: can't get element of local %i in frame 0x%x with %i locals\n",
     846                localIndex, (unsigned int) varFramePtr, localCt);
     847        panic("TclGetElementOfIndexedArray: bad local index %i in frame 0x%x",
     848                localIndex, (unsigned int) varFramePtr);
     849    }
     850#endif /* TCL_COMPILE_DEBUG */
     851
    816852    /*
    817853     * THIS FAILS IF THE ELEMENT NAME OBJECT'S STRING REP HAS A NULL BYTE.
     
    14131449    Tcl_Obj *resultPtr = NULL;
    14141450
     1451#ifdef TCL_COMPILE_DEBUG
     1452    Proc *procPtr = varFramePtr->procPtr;
     1453    int localCt = procPtr->numCompiledLocals;
     1454
     1455    if (compiledLocals == NULL) {
     1456        fprintf(stderr, "\nTclSetIndexedScalar: can't set local %i in frame 0x%x, no compiled locals\n",
     1457                localIndex, (unsigned int) varFramePtr);
     1458        panic("TclSetIndexedScalar: no compiled locals in frame 0x%x",
     1459                (unsigned int) varFramePtr);
     1460    }
     1461    if ((localIndex < 0) || (localIndex >= localCt)) {
     1462        fprintf(stderr, "\nTclSetIndexedScalar: can't set local %i in frame 0x%x with %i locals\n",
     1463                localIndex, (unsigned int) varFramePtr, localCt);
     1464        panic("TclSetIndexedScalar: bad local index %i in frame 0x%x",
     1465                localIndex, (unsigned int) varFramePtr);
     1466    }
     1467#endif /* TCL_COMPILE_DEBUG */
     1468   
    14151469    varPtr = &(compiledLocals[localIndex]);
    14161470    varName = varPtr->name;
     
    15811635    int new;
    15821636   
     1637#ifdef TCL_COMPILE_DEBUG
     1638    Proc *procPtr = varFramePtr->procPtr;
     1639    int localCt = procPtr->numCompiledLocals;
     1640
     1641    if (compiledLocals == NULL) {
     1642        fprintf(stderr, "\nTclSetElementOfIndexedArray: can't set element of local %i in frame 0x%x, no compiled locals\n",
     1643                localIndex, (unsigned int) varFramePtr);
     1644        panic("TclSetIndexedScalar: no compiled locals in frame 0x%x",
     1645                (unsigned int) varFramePtr);
     1646    }
     1647    if ((localIndex < 0) || (localIndex >= localCt)) {
     1648        fprintf(stderr, "\nTclSetIndexedScalar: can't set elememt of local %i in frame 0x%x with %i locals\n",
     1649                localIndex, (unsigned int) varFramePtr, localCt);
     1650        panic("TclSetElementOfIndexedArray: bad local index %i in frame 0x%x",
     1651                localIndex, (unsigned int) varFramePtr);
     1652    }
     1653#endif /* TCL_COMPILE_DEBUG */
     1654
    15831655    /*
    15841656     * THIS FAILS IF THE ELEMENT NAME OBJECT'S STRING REP HAS A NULL BYTE.
Note: See TracChangeset for help on using the changeset viewer.