summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-09 12:33:45 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-09 12:33:45 (GMT)
commit769d959f080ba9349c760f556b1064c47a88b28d (patch)
tree27db300585a58a7ebc136cbaba74da3711ec9d0b /generic/tclDictObj.c
parent4f51c434a64c980708d570c083a0682acebd0b7b (diff)
downloadtcl-769d959f080ba9349c760f556b1064c47a88b28d.zip
tcl-769d959f080ba9349c760f556b1064c47a88b28d.tar.gz
tcl-769d959f080ba9349c760f556b1064c47a88b28d.tar.bz2
Restore API compatibility with public Tcl_*Scan and Tcl_*Convert functions (changes in private functions are OK)
Increase LOCAL_SIZE to 64, and remove two Panic's which cannot occur any more as a result of the improvements.
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 25124a1..2bc5f81 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -487,7 +487,7 @@ static void
UpdateStringOfDict(
Tcl_Obj *dictPtr)
{
-#define LOCAL_SIZE 20
+#define LOCAL_SIZE 64
char localFlags[LOCAL_SIZE], *flagPtr = NULL;
Dict *dict = dictPtr->internalRep.otherValuePtr;
ChainEntry *cPtr;
@@ -495,7 +495,6 @@ UpdateStringOfDict(
int i, length, bytesNeeded = 0;
const char *elem;
char *dst;
- const int maxFlags = UINT_MAX / sizeof(int);
/*
* This field is the most useful one in the whole hash structure, and it
@@ -517,10 +516,8 @@ UpdateStringOfDict(
if (numElems <= LOCAL_SIZE) {
flagPtr = localFlags;
- } else if (numElems > maxFlags) {
- Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
} else {
- flagPtr = ckalloc(numElems * sizeof(char));
+ flagPtr = ckalloc(numElems);
}
for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
/*