Tcl Source Code

Check-in [f61c86cef1]
Login

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

Overview
Comment:[Bug 3496014] Unecessary memset() in Tcl_SetByteArrayObj().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f61c86cef1ff31a68f68f7b9e8ad45ffeac78012
User & Date: jan.nijtmans 2012-08-23 12:11:11
Context
2012-08-23
20:18
small wrapper for TclWinNToHs, for change in calling convention check-in: 65be206be4 user: jan.nijtmans tags: trunk
14:37
merge trunk check-in: b691687908 user: dgp tags: core-8-6-b3-rc
12:11
[Bug 3496014] Unecessary memset() in Tcl_SetByteArrayObj(). check-in: f61c86cef1 user: jan.nijtmans tags: trunk
12:07
[Bug 3496014] Protect Tcl_SetByteArrayObj for invalid values (Backported from Tcl 8.6) check-in: 268122a79b user: jan.nijtmans tags: core-8-5-branch
2012-08-20
23:50
3559678 Fix bad filename normalization when the last component is the empty string. check-in: ec32e3cc76 user: dgp tags: trunk
2012-07-16
20:31
[Bug 3496014]: Unecessary memset() in Tcl_SetByteArrayObj() Closed-Leaf check-in: b4ec99a4a5 user: jan.nijtmans tags: bug-3496014
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-08-20  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3559678] Fix bad filename normalization
	when the last component is the empty string.

2012-08-20  Jan Nijtmans  <[email protected]>

>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-08-23  Jan Nijtmans  <[email protected]>

	* generic/tclBinary.c: [Bug 3496014] Unecessary memset() in
	Tcl_SetByteArrayObj().

2012-08-20  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3559678] Fix bad filename normalization
	when the last component is the empty string.

2012-08-20  Jan Nijtmans  <[email protected]>

Changes to generic/tclBinary.c.

299
300
301
302
303
304
305

306

307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
    }
    TclFreeIntRep(objPtr);
    Tcl_InvalidateStringRep(objPtr);


    length = (length < 0) ? 0 : length;

    byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
    byteArrayPtr->used = length;
    byteArrayPtr->allocated = length;
    if (length) {
	if (bytes) {
	    memcpy(byteArrayPtr->bytes, bytes, (size_t) length);
	} else {
	    memset(byteArrayPtr->bytes, 0, (size_t) length);
	}
    }

    objPtr->typePtr = &tclByteArrayType;
    SET_BYTEARRAY(objPtr, byteArrayPtr);
}

/*







>
|
>



|
<
|
<
<
<







299
300
301
302
303
304
305
306
307
308
309
310
311
312

313



314
315
316
317
318
319
320

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
    }
    TclFreeIntRep(objPtr);
    Tcl_InvalidateStringRep(objPtr);

    if (length < 0) {
	length = 0;
    }
    byteArrayPtr = ckalloc(BYTEARRAY_SIZE(length));
    byteArrayPtr->used = length;
    byteArrayPtr->allocated = length;
    if (length && bytes) {

	memcpy(byteArrayPtr->bytes, bytes, (size_t) length);



    }

    objPtr->typePtr = &tclByteArrayType;
    SET_BYTEARRAY(objPtr, byteArrayPtr);
}

/*