From 32286f19cd1be9fcb882750e70838e31e18f9836 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 14 Oct 2008 19:26:59 +0000 Subject: * generic/tclExecute.c: Fix compile warnings when --enable-symbols=all. * generic/tclCmdIL.c: Fix write to unallocated memory whenever [lrepeat] returns an empty list. --- ChangeLog | 7 +++++++ generic/tclCmdIL.c | 11 ++++++----- generic/tclExecute.c | 6 +++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd34ac7..364c2b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-10-14 Don Porter + + * generic/tclExecute.c: Fix compile warnings when --enable-symbols=all. + + * generic/tclCmdIL.c: Fix write to unallocated memory whenever + [lrepeat] returns an empty list. + 2008-10-14 Donal K. Fellows * doc/chan.n, doc/fconfigure.n: Added even more emphatic text to diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 471560d..d1174ab 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.160 2008/10/07 17:57:43 msofer Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.161 2008/10/14 19:26:59 dgp Exp $ */ #include "tclInt.h" @@ -2446,7 +2446,6 @@ Tcl_LrepeatObjCmd( { int elementCount, i, totalElems; Tcl_Obj *listPtr, **dataArray; - List *listRepPtr; /* * Check arguments for legality: @@ -2496,9 +2495,11 @@ Tcl_LrepeatObjCmd( */ listPtr = Tcl_NewListObj(totalElems, NULL); - listRepPtr = listPtr->internalRep.twoPtrValue.ptr1; - listRepPtr->elemCount = elementCount*objc; - dataArray = &listRepPtr->elements; + if (totalElems) { + List *listRepPtr = listPtr->internalRep.twoPtrValue.ptr1; + listRepPtr->elemCount = elementCount*objc; + dataArray = &listRepPtr->elements; + } /* * Set the elements. Note that we handle the common degenerate case of a diff --git a/generic/tclExecute.c b/generic/tclExecute.c index c6bce03..674cd56 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.415 2008/10/07 21:24:43 nijtmans Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.416 2008/10/14 19:26:59 dgp Exp $ */ #include "tclInt.h" @@ -660,7 +660,7 @@ static int EvalStatsCmd(ClientData clientData, Tcl_Obj *const objv[]); #endif /* TCL_COMPILE_STATS */ #ifdef TCL_COMPILE_DEBUG -static char * GetOpcodeName(unsigned char *pc); +static CONST86 char * GetOpcodeName(unsigned char *pc); static void PrintByteCodeInfo(ByteCode *codePtr); static const char * StringForResultCode(int result); static void ValidatePcAndStackTop(ByteCode *codePtr, @@ -8431,7 +8431,7 @@ GetExceptRangeForPc( */ #ifdef TCL_COMPILE_DEBUG -static char * +static CONST86 char * GetOpcodeName( unsigned char *pc) /* Points to the instruction whose name should * be returned. */ -- cgit v0.12