Tcl Source Code

Check-in [6a52542dcc]
Login

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

Overview
Comment:test case for bug-3598580: Tcl_ListObjReplace may release deleted elements too early
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6a52542dccb46d851194226f0cfeae401546a777
User & Date: jan.nijtmans 2013-01-03 09:46:57
Context
2013-01-03
10:23
Added mechanism for pre-parsing built-in ensembles even when they are not going to generate specific... check-in: 0a095f089c user: dkf tags: trunk
09:46
test case for bug-3598580: Tcl_ListObjReplace may release deleted elements too early check-in: 6a52542dcc user: jan.nijtmans tags: trunk
09:29
test case for bug-3598580: Tcl_ListObjReplace may release deleted elements too early check-in: 93213f3e6d user: jan.nijtmans tags: core-8-5-branch
2013-01-02
19:28
no changes, sync with core-8-5-branch to signal the backported fix check-in: b3100f7283 user: mig tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclTestObj.c.

959
960
961
962
963
964
965











966
967
968
969
970
971
972
	}
	string = Tcl_GetString(objv[3]);
	if (GetVariableIndex(interp, string, &destIndex) != TCL_OK) {
	    return TCL_ERROR;
	}
	SetVarToObj(varPtr, destIndex, varPtr[varIndex]);
	Tcl_SetObjResult(interp, varPtr[destIndex]);











    } else if (strcmp(subCmd, "convert") == 0) {
	const char *typeName;

	if (objc != 4) {
	    goto wrongNumArgs;
	}
	index = Tcl_GetString(objv[2]);







>
>
>
>
>
>
>
>
>
>
>







959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
	}
	string = Tcl_GetString(objv[3]);
	if (GetVariableIndex(interp, string, &destIndex) != TCL_OK) {
	    return TCL_ERROR;
	}
	SetVarToObj(varPtr, destIndex, varPtr[varIndex]);
	Tcl_SetObjResult(interp, varPtr[destIndex]);
    } else if (strcmp(subCmd, "bug3598580") == 0) {
	Tcl_Obj *listObjPtr, *elemObjPtr;
	if (objc != 2) {
	    goto wrongNumArgs;
	}
	elemObjPtr = Tcl_NewIntObj(123);
	listObjPtr = Tcl_NewListObj(1, &elemObjPtr);
	/* Replace the single list element through itself, nonsense but legal. */
	Tcl_ListObjReplace(interp, listObjPtr, 0, 1, 1, &elemObjPtr);
	Tcl_SetObjResult(interp, listObjPtr);
	return TCL_OK;
    } else if (strcmp(subCmd, "convert") == 0) {
	const char *typeName;

	if (objc != 4) {
	    goto wrongNumArgs;
	}
	index = Tcl_GetString(objv[2]);

Changes to tests/listObj.test.

191
192
193
194
195
196
197




198
199
200
201
202
203
204
	    [testlistobj get 1]
    }
    -cleanup {
	testobj freeallvars
    }
    -result {{a b c d e} {} {a b c d e f}}
}





# cleanup
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl







>
>
>
>







191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
	    [testlistobj get 1]
    }
    -cleanup {
	testobj freeallvars
    }
    -result {{a b c d e} {} {a b c d e f}}
}

test listobj-11.1 {bug 3598580} {
    testobj bug3598580
} 123

# cleanup
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl