2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
|
* limit during "mixed" evaluation and compilation process (nested
* eval+compile) and is good enough for default recursionlimit (1000).
*/
if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"too many nested compilations (infinite loop?)",
TCL_AUTO_LENGTH));
Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", (char *)NULL);
TclCompileSyntaxError(interp, envPtr);
return;
}
if (numBytes < 0) {
numBytes = strlen(script);
}
/* Each iteration compiles one command from the script. */
if (numBytes > 0) {
if (numBytes >= INT_MAX) {
/*
* Note this gets -errorline as 1. Not worth figuring out which line
* crosses the limit to get -errorline for this error case.
*/
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"Script length %" TCL_SIZE_MODIFIER
"d exceeds max permitted length %d.",
numBytes, INT_MAX - 1));
Tcl_SetErrorCode(interp, "TCL", "LIMIT", "SCRIPTLENGTH", (char *)NULL);
TclCompileSyntaxError(interp, envPtr);
return;
}
/*
* Don't use system stack (size of Tcl_Parse is ca. 400 bytes), so
* many nested compilations (body enclosed in body) can cause abnormal
* program termination with a stack overflow exception, bug [fec0c17d39].
|
|
|
|
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
|
* limit during "mixed" evaluation and compilation process (nested
* eval+compile) and is good enough for default recursionlimit (1000).
*/
if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"too many nested compilations (infinite loop?)",
TCL_AUTO_LENGTH));
TclSetErrorCode(interp, "TCL", "LIMIT", "STACK");
TclCompileSyntaxError(interp, envPtr);
return;
}
if (numBytes < 0) {
numBytes = strlen(script);
}
/* Each iteration compiles one command from the script. */
if (numBytes > 0) {
if (numBytes >= INT_MAX) {
/*
* Note this gets -errorline as 1. Not worth figuring out which line
* crosses the limit to get -errorline for this error case.
*/
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"Script length %" TCL_SIZE_MODIFIER
"d exceeds max permitted length %d.",
numBytes, INT_MAX - 1));
TclSetErrorCode(interp, "TCL", "LIMIT", "SCRIPTLENGTH");
TclCompileSyntaxError(interp, envPtr);
return;
}
/*
* Don't use system stack (size of Tcl_Parse is ca. 400 bytes), so
* many nested compilations (body enclosed in body) can cause abnormal
* program termination with a stack overflow exception, bug [fec0c17d39].
|