diff options
author | dkf <dkf@noemail.net> | 2014-06-07 14:18:40 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2014-06-07 14:18:40 (GMT) |
commit | 0f7502281b08609ee3b3e4df98de5762dc39930d (patch) | |
tree | 3dc0edbdc401968bdcdfaaa8a49140acc6392bb1 /generic/tclDictObj.c | |
parent | 4944317b62de7e83ae59995a62029a63a78db538 (diff) | |
download | tcl-0f7502281b08609ee3b3e4df98de5762dc39930d.zip tcl-0f7502281b08609ee3b3e4df98de5762dc39930d.tar.gz tcl-0f7502281b08609ee3b3e4df98de5762dc39930d.tar.bz2 |
Improved the error messages.
We do not want parsing an invalid dictionary to give errors about lists!
FossilOrigin-Name: 19696789805f725cde60d0a7404fc614b361b824
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r-- | generic/tclDictObj.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index f3c582c..77f66fb 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -651,9 +651,9 @@ SetDictFromAny( const char *elemStart; int elemSize, literal; - if (TclFindElement(interp, nextElem, (limit - nextElem), + if (TclFindDictElement(interp, nextElem, (limit - nextElem), &elemStart, &nextElem, &elemSize, &literal) != TCL_OK) { - goto errorInFindElement; + goto errorInFindDictElement; } if (elemStart == limit) { break; @@ -672,10 +672,10 @@ SetDictFromAny( keyPtr->bytes); } - if (TclFindElement(interp, nextElem, (limit - nextElem), + if (TclFindDictElement(interp, nextElem, (limit - nextElem), &elemStart, &nextElem, &elemSize, &literal) != TCL_OK) { TclDecrRefCount(keyPtr); - goto errorInFindElement; + goto errorInFindDictElement; } if (literal) { @@ -720,12 +720,8 @@ SetDictFromAny( Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing value to go with key", -1)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", NULL); - } else { - errorInFindElement: - if (interp != NULL) { - Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", NULL); - } } + errorInFindDictElement: DeleteChainTable(dict); ckfree(dict); return TCL_ERROR; |