Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Revise TclReleaseLiteral() to tolerate a NULL interp argument. Update callers and revise mistaken comments. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c192ffaad6dca25481431d83c7f05010 |
User & Date: | dgp 2013-02-28 17:08:43 |
Context
2013-03-01
| ||
18:33 | [Bug 3606542]: Add missing constraint to test. check-in: 068506d5f1 user: dkf tags: trunk | |
2013-02-28
| ||
17:09 | merge trunk check-in: e37a95335b user: dgp tags: dgp-refactor | |
17:08 | Revise TclReleaseLiteral() to tolerate a NULL interp argument. Update callers and revise mistaken co... check-in: c192ffaad6 user: dgp tags: trunk | |
14:19 | fix coroutine-4.6 so that it runs in isolation, [Bug 3606395] check-in: 2c8c39bdf1 user: mig tags: trunk | |
Changes
Changes to ChangeLog.
1 2 3 4 5 6 7 | 2013-02-27 Jan Nijtmans <[email protected]> * generic/regcomp.c: [Bug 3606139]: missing error check allows * tests/regexp.test: regexp to crash Tcl. Thanks to Tom Lane for providing the test-case and the patch. 2013-02-26 Donal K. Fellows <[email protected]> | > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 2013-02-28 Don Porter <[email protected]> * generic/tclLiteral.c: Revise TclReleaseLiteral() to tolerate a NULL interp argument. * generic/tclCompile.c: Update callers and revise mistaken comments. * generic/tclProc.c: 2013-02-27 Jan Nijtmans <[email protected]> * generic/regcomp.c: [Bug 3606139]: missing error check allows * tests/regexp.test: regexp to crash Tcl. Thanks to Tom Lane for providing the test-case and the patch. 2013-02-26 Donal K. Fellows <[email protected]> |
︙ | ︙ |
Changes to generic/tclCompile.c.
︙ | ︙ | |||
914 915 916 917 918 919 920 | * when it contains non-shared literals [Bug 983660], we also distinguish * the case of an interpreter being deleted (signaled by interp == NULL). * Also, as the interp deletion will remove the global literal table * anyway, we avoid the extra cost of updating it for each literal being * released. */ | | | < | < < < < < | < < | 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 | * when it contains non-shared literals [Bug 983660], we also distinguish * the case of an interpreter being deleted (signaled by interp == NULL). * Also, as the interp deletion will remove the global literal table * anyway, we avoid the extra cost of updating it for each literal being * released. */ if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { objArrayPtr = codePtr->objArrayPtr; for (i = 0; i < numLitObjects; i++) { objPtr = *objArrayPtr; if (objPtr) { Tcl_DecrRefCount(objPtr); } objArrayPtr++; } codePtr->numLitObjects = 0; } else { objArrayPtr = codePtr->objArrayPtr; while (numLitObjects--) { /* TclReleaseLiteral calls Tcl_DecrRefCount() for us */ TclReleaseLiteral(interp, *objArrayPtr++); } } auxDataPtr = codePtr->auxDataArrayPtr; for (i = 0; i < numAuxDataItems; i++) { if (auxDataPtr->type->freeProc != NULL) { auxDataPtr->type->freeProc(auxDataPtr->clientData); |
︙ | ︙ |
Changes to generic/tclLiteral.c.
︙ | ︙ | |||
746 747 748 749 750 751 752 | Tcl_Interp *interp, /* Interpreter for which objPtr was created to * hold a literal. */ register Tcl_Obj *objPtr) /* Points to a literal object that was * previously created by a call to * TclRegisterLiteral. */ { Interp *iPtr = (Interp *) interp; | | > > > > > | 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 | Tcl_Interp *interp, /* Interpreter for which objPtr was created to * hold a literal. */ register Tcl_Obj *objPtr) /* Points to a literal object that was * previously created by a call to * TclRegisterLiteral. */ { Interp *iPtr = (Interp *) interp; LiteralTable *globalTablePtr; register LiteralEntry *entryPtr, *prevPtr; const char *bytes; int length, index; if (iPtr == NULL) { goto done; } globalTablePtr = &iPtr->literalTable; bytes = TclGetStringFromObj(objPtr, &length); index = (HashString(bytes, length) & globalTablePtr->mask); /* * Check to see if the object is in the global literal table and remove * this reference. The object may not be in the table if it is a hidden * local literal. |
︙ | ︙ | |||
794 795 796 797 798 799 800 801 802 803 804 805 806 807 | } } /* * Remove the reference corresponding to the local literal table entry. */ Tcl_DecrRefCount(objPtr); } /* *---------------------------------------------------------------------- * * HashString -- | > | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 | } } /* * Remove the reference corresponding to the local literal table entry. */ done: Tcl_DecrRefCount(objPtr); } /* *---------------------------------------------------------------------- * * HashString -- |
︙ | ︙ |
Changes to generic/tclProc.c.
︙ | ︙ | |||
1343 1344 1345 1346 1347 1348 1349 | { int i; Tcl_Obj **namePtrPtr = &localCachePtr->varName0; for (i = 0; i < localCachePtr->numVars; i++, namePtrPtr++) { register Tcl_Obj *objPtr = *namePtrPtr; | < < < < < < > | < < < | 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 | { int i; Tcl_Obj **namePtrPtr = &localCachePtr->varName0; for (i = 0; i < localCachePtr->numVars; i++, namePtrPtr++) { register Tcl_Obj *objPtr = *namePtrPtr; if (objPtr) { /* TclReleaseLiteral calls Tcl_DecrRefCount for us */ TclReleaseLiteral(interp, objPtr); } } ckfree(localCachePtr); } static void InitLocalCache( |
︙ | ︙ |