summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-01-08 16:41:34 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-01-08 16:41:34 (GMT)
commita23a10f4460267a77fa20b723239edaf3a5ce877 (patch)
tree267ec42d4b8749e2fc3f2492f172710bd8a8b5d0 /generic/tclListObj.c
parente241610f648c4f00d9f6b5bff043a865ba8f0054 (diff)
downloadtcl-a23a10f4460267a77fa20b723239edaf3a5ce877.zip
tcl-a23a10f4460267a77fa20b723239edaf3a5ce877.tar.gz
tcl-a23a10f4460267a77fa20b723239edaf3a5ce877.tar.bz2
Generate errorcodes for more cases.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index b8f9da7..be18699 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclListObj.c,v 1.55 2008/10/15 06:17:04 nijtmans Exp $
+ * RCS: @(#) $Id: tclListObj.c,v 1.56 2009/01/08 16:41:34 dkf Exp $
*/
#include "tclInt.h"
@@ -1705,6 +1705,7 @@ SetListFromAny(
Tcl_SetResult(interp,
"insufficient memory to allocate list working space",
TCL_STATIC);
+ Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
}
listRepPtr->elemCount = 2 * size;
@@ -1764,6 +1765,7 @@ SetListFromAny(
if (!listRepPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"Not enough memory to allocate the list internal rep", -1));
+ Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
}
elemPtrs = &listRepPtr->elements;
@@ -1779,6 +1781,9 @@ SetListFromAny(
Tcl_DecrRefCount(elemPtr);
}
ckfree((char *) listRepPtr);
+ if (interp != NULL) {
+ Tcl_SetErrorCode(interp, "TCL", "VALUE", "LIST", NULL);
+ }
return result;
}
if (elemStart >= limit) {