Changes On Branch mistake
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch mistake Excluding Merge-Ins

This is equivalent to a diff from 142fb1767c to f47e0fa249

2025-05-27
05:02
Merge 9.0. Disable unsupported icu tests for valgrind as dl_load of icu muddies valgrind output check-in: ef7f12a7fc user: apnadkarni tags: trunk, main
03:23
Proposed fix for memory leak in TclCompileTryCmd check-in: bef78c2964 user: apnadkarni tags: bug-c587295271-trycompile-leak
2025-05-26
16:47
Proposed fix for [c587295271] - memory leak in TclCompileTryCmd Closed-Leaf check-in: f47e0fa249 user: apnadkarni tags: mistake
12:59
Add some more Tcl_Attempt* functions Leaf check-in: 3c0642b89c user: jan.nijtmans tags: attemptgetstring
11:59
Merge mark for 9.0 changes.md check-in: 142fb1767c user: apnadkarni tags: trunk, main
11:56
Update changes for fixed tickets check-in: 28eab946c5 user: apnadkarni tags: core-9-0-branch
11:48
Merge 9.0 check-in: bf0c98b4c3 user: jan.nijtmans tags: trunk, main

Changes to generic/tclCompCmdsSZ.c.
2836
2837
2838
2839
2840
2841
2842
2843

2844
2845
2846
2847
2848
2849
2850
2836
2837
2838
2839
2840
2841
2842

2843
2844
2845
2846
2847
2848
2849
2850







-
+







    TCL_UNUSED(Command *),
    CompileEnv *envPtr)		/* Holds resulting instructions. */
{
    Tcl_Size numHandlers, numWords = parsePtr->numWords;
    int result = TCL_ERROR, anyTrapClauses = 0;
    Tcl_Token *bodyToken, *finallyToken, *tokenPtr;
    TryHandlerInfo staticHandler, *handlers = &staticHandler;
    Tcl_Size handlerIdx = 0;
    Tcl_Size handlerIdx = -1;

    if (numWords < 2 || numWords > UINT_MAX) {
	return TCL_ERROR;
    }

    bodyToken = TokenAfter(parsePtr->tokenPtr);
    numWords -= 2;
2860
2861
2862
2863
2864
2865
2866
2867

2868
2869


2870
2871
2872
2873
2874
2875
2876
2860
2861
2862
2863
2864
2865
2866

2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878







-
+


+
+







	if (numHandlers > 1) {
	    handlers = (TryHandlerInfo *)TclStackAlloc(interp,
		    sizeof(TryHandlerInfo) * numHandlers);
	} else {
	    handlers = &staticHandler;
	}

	for (; handlerIdx < numHandlers ; handlerIdx++) {
	for (handlerIdx = 0; handlerIdx < numHandlers ; handlerIdx++) {
	    Tcl_Obj *tmpObj, **objv;
	    Tcl_Size objc;

	    handlers[handlerIdx].matchClause = NULL;/* Init for cleanup checks */

	    if (IS_TOKEN_LITERALLY(tokenPtr, "trap")) {
		/*
		 * Parse the list of errorCode words to match against.
		 */

		handlers[handlerIdx].matchCode = TCL_ERROR;
3029
3030
3031
3032
3033
3034
3035
3036

3037
3038
3039

3040
3041
3042
3043
3044
3045
3046
3031
3032
3033
3034
3035
3036
3037

3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049







-
+



+







    }

    /*
     * Delete any temporary state and finish off.
     */

  failedToCompile:
    while (handlerIdx-- > 0) {
    while (handlerIdx >= 0) {
	if (handlers[handlerIdx].matchClause) {
	    TclDecrRefCount(handlers[handlerIdx].matchClause);
	}
	--handlerIdx;
    }
    if (handlers != &staticHandler) {
	TclStackFree(interp, handlers);
    }
    return result;
}