diff options
author | avl <avl> | 2017-03-05 15:05:48 (GMT) |
---|---|---|
committer | avl <avl> | 2017-03-05 15:05:48 (GMT) |
commit | 08192ab42f794f6a486fdc21a537cce794f04472 (patch) | |
tree | 28a3c3a3d6d64830f1df23611f7ead6521f8f9a0 | |
parent | 838c36a45d377ef799dd45158832040a6a528d91 (diff) | |
download | tcl-08192ab42f794f6a486fdc21a537cce794f04472.zip tcl-08192ab42f794f6a486fdc21a537cce794f04472.tar.gz tcl-08192ab42f794f6a486fdc21a537cce794f04472.tar.bz2 |
Fix for Ticket [71c0878b71] + test cases
-rw-r--r-- | generic/tclStrToD.c | 2 | ||||
-rw-r--r-- | tests/incr.test | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 77e1839..224ab45 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -539,7 +539,7 @@ TclParseNumber( */ if (bytes == NULL) { - if (endPtrPtr == NULL) { + if (interp == NULL && endPtrPtr == NULL) { if (objPtr->typePtr == &tclDictType) { /* A dict can never be a (single) number */ return TCL_ERROR; diff --git a/tests/incr.test b/tests/incr.test index 9243be0..aa2872a 100644 --- a/tests/incr.test +++ b/tests/incr.test @@ -494,6 +494,18 @@ test incr-2.31 {incr command (compiled): bad increment} { (reading increment) invoked from within "incr x 1a"}} +test incr-2.32 {incr command (compiled): bad pure list increment} { + list [catch {incr x [list 1 2]} msg] $msg $::errorInfo +} {1 {expected integer but got "1 2"} {expected integer but got "1 2" + (reading increment) + invoked from within +"incr x [list 1 2]"}} +test incr-2.33 {incr command (compiled): bad pure dict increment} { + list [catch {incr x [dict create 1 2]} msg] $msg $::errorInfo +} {1 {expected integer but got "1 2"} {expected integer but got "1 2" + (reading increment) + invoked from within +"incr x [dict create 1 2]"}} test incr-3.1 {increment by wide amount: bytecode route} { set x 0 |