Tcl Source Code

Check-in [c5126a3728]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:merge 8.7
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-421
Files: files | file ages | folders
SHA3-256: c5126a3728670143da564bda6752797cc5d030d2542e4ca20c89b8c4d5f4aedd
User & Date: dgp 2018-03-11 22:34:51
Context
2018-03-15
14:18
merge 8.7 check-in: 16cda61498 user: dgp tags: tip-421
2018-03-11
22:34
merge 8.7 check-in: c5126a3728 user: dgp tags: tip-421
21:29
merge 8.6 check-in: 23c46c8cd1 user: dgp tags: core-8-branch
2018-03-10
16:03
merge 8.7 check-in: 01268def02 user: dgp tags: tip-421
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclExecute.c.

  4955   4955   	 */
  4956   4956   
  4957   4957   #ifndef TCL_COMPILE_DEBUG
  4958   4958   	if (*(pc+9) == INST_POP) {
  4959   4959   	    NEXT_INST_F(10, 1, 0);
  4960   4960   	}
  4961   4961   #endif
         4962  +
         4963  +	/* Every range of an empty list is an empty list */
         4964  +	if (objc == 0) {
         4965  +	    TRACE_APPEND(("\n"));
         4966  +	    NEXT_INST_F(9, 0, 0);
         4967  +	}
  4962   4968   
  4963   4969   	/* Decode index value operands. */
  4964   4970   
  4965   4971   	/* 
  4966   4972   	assert ( toIdx != TCL_INDEX_AFTER);
  4967   4973   	 *
  4968   4974   	 * Extra safety for legacy bytecodes:

Changes to generic/tclOO.c.

   628    628       ClientData clientData,	/* Pointer to the OO system foundation
   629    629   				 * structure. */
   630    630       Tcl_Interp *interp)		/* The interpreter containing the OO system
   631    631   				 * foundation. */
   632    632   {
   633    633       Foundation *fPtr = GetFoundation(interp);
   634    634   
          635  +    /*
          636  +     * Crude mechanism to avoid leaking the Object struct of the
          637  +     * foundation components oo::object and oo::class
          638  +     *
          639  +     * Should probably be replaced with something more elegantly designed.
          640  +     */
          641  +    while (TclOODecrRefCount(fPtr->objectCls->thisPtr) == 0) {};
          642  +    while (TclOODecrRefCount(fPtr->classCls->thisPtr) == 0) {};
          643  +
   635    644       TclDecrRefCount(fPtr->unknownMethodNameObj);
   636    645       TclDecrRefCount(fPtr->constructorName);
   637    646       TclDecrRefCount(fPtr->destructorName);
   638    647       TclDecrRefCount(fPtr->clonedName);
   639    648       TclDecrRefCount(fPtr->defineName);
   640    649       ckfree(fPtr);
   641    650   }
................................................................................
  1016   1025       if (clsPtr->filters.num) {
  1017   1026   	Tcl_Obj *filterObj;
  1018   1027   
  1019   1028   	FOREACH(filterObj, clsPtr->filters) {
  1020   1029   	    TclDecrRefCount(filterObj);
  1021   1030   	}
  1022   1031   	ckfree(clsPtr->filters.list);
         1032  +	clsPtr->filters.list = NULL;
  1023   1033   	clsPtr->filters.num = 0;
  1024   1034       }
         1035  +
         1036  +    /*
         1037  +     * Squelch our instances.
         1038  +     */
         1039  +
         1040  +    if (clsPtr->instances.num) {
         1041  +	Object *oPtr;
         1042  +
         1043  +	FOREACH(oPtr, clsPtr->instances) {
         1044  +	    TclOODecrRefCount(oPtr);
         1045  +	}
         1046  +	ckfree(clsPtr->instances.list);
         1047  +	clsPtr->instances.list = NULL;
         1048  +	clsPtr->instances.num = 0;
         1049  +    }
  1025   1050   
  1026   1051       /*
  1027   1052        * Squelch our metadata.
  1028   1053        */
  1029   1054   
  1030   1055       if (clsPtr->metadataPtr != NULL) {
  1031   1056   	Tcl_ObjectMetadataType *metadataTypePtr;

Changes to generic/tclPkg.c.

  1244   1244   	    }
  1245   1245   
  1246   1246   	    /*
  1247   1247   	     * Create a new-style requirement for the exact version.
  1248   1248   	     */
  1249   1249   
  1250   1250   	    ov = Tcl_NewStringObj(version, -1);
  1251         -	    Tcl_IncrRefCount(ov);
  1252   1251   	    Tcl_AppendStringsToObj(ov, "-", version, NULL);
  1253   1252   	    version = NULL;
  1254   1253   	    argv3 = TclGetString(objv[3]);
  1255   1254   	    Tcl_IncrRefCount(objv[3]);
  1256   1255   
  1257   1256   	    objvListPtr = Tcl_NewListObj(0, NULL);
  1258   1257   	    Tcl_IncrRefCount(objvListPtr);