Tcl Source Code

Check-in [b9d1a1ce1a]
Login

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

Overview
Comment:Initialize Proc.cmdPtr to NULL when creating a new procedure.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-3422267ed6b79922
Files: files | file ages | folders
SHA3-256: b9d1a1ce1aef55c3fe8a68886cc85f754d7d3d7a6c5e1fc5fa120a0be2d7ee4f
User & Date: pooryorick 2020-08-12 17:33:33
References
2020-08-12
18:15 Ticket [3422267ed6] segmentation fault from deleting the the target of an imported alias during a trace on the target of the alias status still Open with 3 other changes artifact: 5726b0cac3 user: pooryorick
Context
2020-08-13
10:19
Merge 8.7 check-in: 9b32b44e04 user: jan.nijtmans tags: bug-3422267ed6b79922
2020-08-12
17:33
Initialize Proc.cmdPtr to NULL when creating a new procedure. check-in: b9d1a1ce1a user: pooryorick tags: bug-3422267ed6b79922
14:46
Fix reference counting for command structure in TclNRApplyObjCmd check-in: de751a3490 user: pooryorick tags: bug-3422267ed6b79922
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclProc.c.

467
468
469
470
471
472
473





474
475
476
477
478
479
480
	 */

	Tcl_IncrRefCount(bodyPtr);

	procPtr = (Proc *)ckalloc(sizeof(Proc));
	procPtr->iPtr = iPtr;
	procPtr->refCount = 1;





	procPtr->bodyPtr = bodyPtr;
	procPtr->numArgs = 0;	/* Actual argument count is set below. */
	procPtr->numCompiledLocals = 0;
	procPtr->firstLocalPtr = NULL;
	procPtr->lastLocalPtr = NULL;
    }








>
>
>
>
>







467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
	 */

	Tcl_IncrRefCount(bodyPtr);

	procPtr = (Proc *)ckalloc(sizeof(Proc));
	procPtr->iPtr = iPtr;
	procPtr->refCount = 1;
	/* if cmdPtr isn't initialized to NULL here
	 * tclOOMethod.c:PushMethodCallFrame stores and attempts to use an
	 * invalid value in fdPtr->oldCmdPtr
	 */
	procPtr->cmdPtr = NULL;
	procPtr->bodyPtr = bodyPtr;
	procPtr->numArgs = 0;	/* Actual argument count is set below. */
	procPtr->numCompiledLocals = 0;
	procPtr->firstLocalPtr = NULL;
	procPtr->lastLocalPtr = NULL;
    }